2

I'm following the Grok tutorial and I'm getting an error on the

 tal:attributes="action view/url" 

portion of a POST form. I assume this plops in the URL, but I'm confused as to why I'm getting the following error.

  File "/root/.buildout/eggs/Chameleon-2.8.5-py2.6.egg/chameleon/utils.py", line 404, in __getitem__
    raise NameError(key)
NameError: url

 - Expression: "view/url"
 - Filename:   /root/Sample/src/sample/app_templates/edit.cpt
 - Location:   (3:29)
 - Source:     <form tal:attributes="action view/url" method="POST">
                                        ^^^^^^^^

I have no experience with Zope or Grok: what am I missing?

dfb
  • 13,133
  • 2
  • 31
  • 52

1 Answers1

0

I have no clue what is the actual reason for the problem (was also just following the tutorial), but it seems that if you replace the problematic place with tal:attributes="action view.url()", the error disappears and you can continue with the tutorial.

(No one cared to answer this for two years, heh)

KT.
  • 10,815
  • 4
  • 47
  • 71
  • Can you try `tal:attributes="action python: view.url()`, `tal:attributes="action view.url()` should not really work?? btw. I did not follow the tutorial, but `view.url()`is python so `tal` should run it as python not as tal expression. – Mathias Sep 09 '14 at 05:59
  • Works this way too. Unfortunately, the tutorial seems to be dead currently, and eventually impossible to complete (e.g. there's a chapter missing), so this whole issue is not too relevant now I believe. – KT. Sep 11 '14 at 23:45
  • As far as I see it, Grok looks abandoned, so not worth digging too deeply into. It is still a decent way to get a quick understanding of "Zope-style" object publishing concepts. – KT. Sep 11 '14 at 23:50