I'm trying to use LoginManager and am running into a little problem, which I'm sure is based in a not-deep-enough understanding of acquisition issues. Bloop ---acl_users ------Z MySQL DA ------SQL_get_password [SQL Method, taking username & password parameters, tested & works] ------xuserAuthenticate [DTML Method: contains the line <dtml-in "SQL_get_password(username='foo',password='bar')">] ------Test [DTML Method: contains the line <dtml-let ret="xuserAuthenticate(username='foo',password='bar')"> If I try to "view" Test, then I get the nasty traceback below. If I view xuserAuthenticate, no such error is reported. I suppose this is because dtml-let puts a "strange" acquisition context in place during the execution of xuserAuthenticate...an execution context that does not include the containing folder of Test (namely acl_users). Or is this due to some strange properties that I am not yet familiar with of acl_user folders? Traceback (innermost last): File D:\CLOAKM~1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File D:\CLOAKM~1\lib\python\ZPublisher\Publish.py, line 187, in publish File D:\CLOAKM~1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: ProviderContainer) File D:\CLOAKM~1\lib\python\ZPublisher\Publish.py, line 171, in publish File D:\CLOAKM~1\lib\python\ZPublisher\mapply.py, line 160, in mapply (Object: Testing2) File D:\CLOAKM~1\lib\python\ZPublisher\Publish.py, line 112, in call_object (Object: Testing2) File D:\CLOAKM~1\lib\python\OFS\DTMLMethod.py, line 189, in __call__ (Object: Testing2) File D:\CloakMail\lib\python\DocumentTemplate\DT_String.py, line 549, in __call__ (Object: Testing2) File D:\CLOAKM~1\lib\python\DocumentTemplate\DT_Let.py, line 146, in render (Object: ret="xuserAuthenticate(username='foo',password='bar')") File D:\CLOAKM~1\lib\python\DocumentTemplate\DT_Util.py, line 334, in eval (Object: xuserAuthenticate(username='foo',password='bar')) (Info: xuserAuthenticate) File <string>, line 0, in ? File D:\CLOAKM~1\lib\python\OFS\DTMLMethod.py, line 182, in __call__ (Object: xuserAuthenticate) File D:\CloakMail\lib\python\DocumentTemplate\DT_String.py, line 549, in __call__ (Object: xuserAuthenticate) File D:\CLOAKM~1\lib\python\DocumentTemplate\DT_In.py, line 649, in renderwob (Object: SQL_get_password(username='foo',password='bar')) File D:\CLOAKM~1\lib\python\DocumentTemplate\DT_Util.py, line 334, in eval (Object: SQL_get_password(username='foo',password='bar')) (Info: SQL_get_password) File <string>, line 0, in ? NameError: (see above)
Hi, I am new to ZOPE and for the first time I am trying the following: /news/index_html /news/sub/text1_html /news/sub/text2_html now I want to include all documents from within the sub folder within my /news/index_html with <dtml-with sub> this works when I list all sub object by hand in dtml- var's, but I wanted to use dtml-in so that I don't have to change index_html each time I added a new object to the sub folder. But my understanding of ZOPE seems to be incomplete because this does not work as it seems: <dtml-in sub> <dtml-var title> <dtml-var "content?"> </dtml-in> how to do this job correctly? Thanks in advance Kai Hofmann -- Institut für Seeverkehrswirtschaft und Logistik http://www.isl.org/ Dipl.-Inform. Kai Hofmann mailto:hofmann@isl.org Universitaetsallee GW1 Block A phone:+49 421 22096-83 D-28359 Bremen fax:+49 421 22096-55
Combine the two: <dtml-with sub> <dtml-in "objectValues()"> <dtml-var title><dtml-var sequence-item> </dtml-in> </dtml-with> With gives you access to the sub folder, in iterates over the items. -- Andy McKay ----- Original Message ----- From: "Kai Hofmann" <hofmann@isl.org> To: <zope@zope.org> Sent: Friday, April 06, 2001 12:44 AM Subject: [Zope] please help with dtml-in Hi, I am new to ZOPE and for the first time I am trying the following: /news/index_html /news/sub/text1_html /news/sub/text2_html now I want to include all documents from within the sub folder within my /news/index_html with <dtml-with sub> this works when I list all sub object by hand in dtml- var's, but I wanted to use dtml-in so that I don't have to change index_html each time I added a new object to the sub folder. But my understanding of ZOPE seems to be incomplete because this does not work as it seems: <dtml-in sub> <dtml-var title> <dtml-var "content?"> </dtml-in> how to do this job correctly? Thanks in advance Kai Hofmann -- Institut für Seeverkehrswirtschaft und Logistik http://www.isl.org/ Dipl.-Inform. Kai Hofmann mailto:hofmann@isl.org Universitaetsallee GW1 Block A phone:+49 421 22096-83 D-28359 Bremen fax:+49 421 22096-55 _______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Zopista wrote:
Combine the two:
<dtml-with sub> <dtml-in "objectValues()"> <dtml-var title><dtml-var sequence-item> </dtml-in> </dtml-with>
With gives you access to the sub folder, in iterates over the items.
Or you can skip the dtml-with and call the objectValues() method of sub directly, like so: <dtml-in "sub.objectValues()"> <dtml-var title> <dtml-var sequence-item> </dtml-in> The stuff in quotes is a python expression which means, call the objectValues method of the object "sub". If sub is a folder, this will loop through the contents of the folder. -- ................... paul winkler .................... custom calendars & printing: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com
Am Freitag, 6. April 2001 10:31 schrieb Paul Winkler:
Or you can skip the dtml-with and call the objectValues() method of sub directly, like so:
<dtml-in "sub.objectValues()"> <dtml-var title> <dtml-var sequence-item> </dtml-in>
The stuff in quotes is a python expression which means, call the objectValues method of the object "sub". If sub is a folder, this will loop through the contents of the folder.
This is a different question, but.... ...can I also add the name of an object in the brackets? Like, when I want to get the values of a certain object in that folder only. e.g.: <dtml-in "sub.objectValues(name_of_object)"> </dtml-in> or <dtml-in "sub.objectValues(<dtml-var object_name)> </dtml-in> Thanks in advance Jan -- Jan@MountainbikeHQ.de http://www.MountainbikeHQ.de - Your home for DH, DS and CC Mountainbiking
Jan Lentfer wrote:
This is a different question, but....
...can I also add the name of an object in the brackets? Like, when I want to get the values of a certain object in that folder only.
e.g.:
<dtml-in "sub.objectValues(name_of_object)"> </dtml-in>
I'm not sure what you mean. I think you're asking how to see name_of_object which is in a folder called sub. You don't need <dtml-in> for that. Try this: <dtml-var "sub.name_of_object"> Or if you just want to print, say, the title of that object... <dtml-var "sub.name_of_object.title"> Remember that the stuff in quotes is python. It's a good idea to learn the very basics of python or you'll be confused by this stuff.
or
<dtml-in "sub.objectValues(<dtml-var object_name)> </dtml-in>
This would be a syntax error. You can't put <dtml-var> inside a python expression. -- ................... paul winkler .................... custom calendars & printing: http://www.calendargalaxy.com A member of ARMS: http://www.reacharms.com home page: http://www.slinkp.com
participants (5)
-
Andrew Athan -
Jan Lentfer -
Kai Hofmann -
Paul Winkler -
Zopista