Keep getting this AttributeError
Hello, I am going nuts here .. I have some code that I use in several places ... but there is one place it won't work. Here's a snip of the code: <dtml-in "cart_obj.listProducts()"> <dtml-let item="_.getitem('sequence-item')"> <dtml-var item> </dtml-let> </dtml-in> The cart_obj is a Shopping Cart object and I have checked (by printing out the REQUEST object on screen) that the object is set. Now this is the error I keep on getting: Error Type: AttributeError Error Value: listProducts And a snip of the traceback: File /usr/local/Zope-2.4.0-linux2-x86/lib/python/DocumentTemplate/DT_Util.py, line 230, in eval (Object: cart_obj.listProducts()) (Info: cart_obj) File <string>, line 2, in f (Object: guarded_getattr) File /usr/local/Zope-2.4.0-linux2-x86/lib/python/AccessControl/DTML.py, line 101, in guarded_getattr (Object: process_ok) File /usr/local/Zope-2.4.0-linux2-x86/lib/python/AccessControl/ZopeGuards.py, line 109, in guarded_getattr AttributeError: (see above) Now I don't know what guarded_getattr is .. And I know that the above code works in the exact same way in another page so ? Any good ideas ? TIA, Gitte Wange
Gitte Wange writes:
I have some code that I use in several places ... but there is one place it won't work.
Here's a snip of the code:
<dtml-in "cart_obj.listProducts()"> <dtml-let item="_.getitem('sequence-item')"> <dtml-var item> </dtml-let> </dtml-in>
The cart_obj is a Shopping Cart object and I have checked (by printing out the REQUEST object on screen) that the object is set.
Now this is the error I keep on getting:
Error Type: AttributeError Error Value: listProducts Seems that the "cart_obj" is something different when it does not work.... Either a different type of object (e.g. a string or a different object class) or maybe some security setting. Sometimes "Unauthorized" is mapped to other errors.
Dieter
participants (2)
-
Dieter Maurer -
Gitte Wange