hi, maybe i'm being trying too much too soon, but i'd appreciate help with the following (i'm new to zope but have used python for years and have some experience with jsp and similar web tech). i am using plone with postgresql. the DA is working. my problems are, i think related to ZTP and how to structure applications. i have the folder "timesheets" defined inside my root folder. as two subfolders i have "sql" and "ztp" in /timesheets/sql are two SQL methods: add_person and list_people. the SQL method /timesheets/sql/list_people returns a list of people from a table. this works (the "test" button produces results; the column name is "person"). but how do i get that data displayed in the ZTP page? i have a page in the /timesheets/ztp folder (also called "list_people") with the following text, but it won't compile: <ul tal:repeat="item /timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul> the error message is: Compilation failed TAL.TALDefs.TALError: Invalid variable name "" in expression '/timesheets/sql/list_people' my problem seems to be accessing the sql method that is "../sql/list_people" relative to the location of the ztp page. how i do this? or is the problem elsewhere? apologies if i've done soemthing very stupid! cheers, andrew -- http://www.acooke.org/andrew
On Saturday, October 25, 2003, at 03:34 PM, andrew cooke wrote:
but how do i get that data displayed in the ZTP page? i have a page in the /timesheets/ztp folder (also called "list_people") with the following text, but it won't compile:
<ul tal:repeat="item /timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul>
the error message is: Compilation failed TAL.TALDefs.TALError: Invalid variable name "" in expression '/timesheets/sql/list_people'
Just timesheets/sql/list_people -- no leading "/". You can get to the content of parent folders by acquisition. Or I believe there is a root object (not sure), so root/timesheets/sql/list_people You get the Invalid variable name "" because it never expects a leading "/", and it assumes there is a variable before the slash (which would have to be the empty string). Not the best error message, I guess... -- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
arrgh - so simple! great, thanks. i'm off home now, but will try that first thing tomorrow. thanks again, andrew Ian Bicking said:
On Saturday, October 25, 2003, at 03:34 PM, andrew cooke wrote:
but how do i get that data displayed in the ZTP page? i have a page in the /timesheets/ztp folder (also called "list_people") with the following text, but it won't compile:
<ul tal:repeat="item /timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul>
the error message is: Compilation failed TAL.TALDefs.TALError: Invalid variable name "" in expression '/timesheets/sql/list_people'
Just timesheets/sql/list_people -- no leading "/". You can get to the content of parent folders by acquisition. Or I believe there is a root object (not sure), so root/timesheets/sql/list_people
You get the Invalid variable name "" because it never expects a leading "/", and it assumes there is a variable before the slash (which would have to be the empty string). Not the best error message, I guess...
-- Ian Bicking | ianb@colorstudy.com | http://blog.ianbicking.org
for the record, the (or, at least, a) solution is: <ul tal:repeat="item root/Plone/timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul> cheers, andrew andrew cooke said:
hi,
maybe i'm being trying too much too soon, but i'd appreciate help with the following (i'm new to zope but have used python for years and have some experience with jsp and similar web tech).
i am using plone with postgresql. the DA is working. my problems are, i think related to ZTP and how to structure applications.
i have the folder "timesheets" defined inside my root folder. as two subfolders i have "sql" and "ztp"
in /timesheets/sql are two SQL methods: add_person and list_people. the SQL method /timesheets/sql/list_people returns a list of people from a table. this works (the "test" button produces results; the column name is "person").
but how do i get that data displayed in the ZTP page? i have a page in the /timesheets/ztp folder (also called "list_people") with the following text, but it won't compile:
<ul tal:repeat="item /timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul>
the error message is: Compilation failed TAL.TALDefs.TALError: Invalid variable name "" in expression '/timesheets/sql/list_people'
my problem seems to be accessing the sql method that is "../sql/list_people" relative to the location of the ztp page. how i do this? or is the problem elsewhere?
apologies if i've done soemthing very stupid! cheers, andrew
-- http://www.acooke.org/andrew
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
andrew cooke wrote:
for the record, the (or, at least, a) solution is:
<ul tal:repeat="item root/Plone/timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul>
... i have the folder "timesheets" defined inside my root folder. as two subfolders i have "sql" and "ztp"
in /timesheets/sql are two SQL methods: add_person and list_people. the SQL method /timesheets/sql/list_people returns a list of people from a table. this works (the "test" button produces results; the column name is "person").
but how do i get that data displayed in the ZTP page? i have a page in the /timesheets/ztp folder (also called "list_people") with the following text, but it won't compile:
<ul tal:repeat="item /timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul>
the error message is: Compilation failed TAL.TALDefs.TALError: Invalid variable name "" in expression '/timesheets/sql/list_people'
my problem seems to be accessing the sql method that is "../sql/list_people" relative to the location of the ztp page. how i do this? or is the problem elsewhere?
I'm not sure what the structure of your site is from the description above, but you can probably (and probably should) let acquisition do the work instead of referring to the root::
<ul tal:repeat="item context/timesheets/sql/list_people"> <li tal:content="item/person">name</li> </ul> or something like that. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (3)
-
andrew cooke -
Ian Bicking -
J. Cameron Cooper