Here's the whole traceback (i don't use hasattr in my code): Traceback (innermost last): File /usr/local/zope/2-2-2/lib/python/ZPublisher/Publish.py, line 222, in publish_module File /usr/local/zope/2-2-2/lib/python/ZPublisher/Publish.py, line 187, in publish File /usr/local/zope/2-2-2/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: 10) File /usr/local/zope/2-2-2/lib/python/ZPublisher/Publish.py, line 171, in publish File /usr/local/zope/2-2-2/lib/python/ZPublisher/mapply.py, line 160, in mapply (Object: editLicenseForm) File /usr/local/zope/2-2-2/lib/python/ZPublisher/Publish.py, line 112, in call_object (Object: editLicenseForm) File /usr/local/zope/2-2-2/lib/python/OFS/DTMLMethod.py, line 172, in __call__ (Object: editLicenseForm) File /usr/local/zope/2-2-2/lib/python/DocumentTemplate/DT_String.py, line 528, in __call__ (Object: editLicenseForm) File /usr/local/zope/2-2-2/lib/python/DocumentTemplate/DT_Let.py, line 147, in render (Object: modList="Products.Modules.getModulesForProduct(this(), _, ProductID)") File /usr/local/zope/2-2-2/lib/python/DocumentTemplate/DT_In.py, line 691, in renderwob (Object: modList) File /usr/local/zope/2-2-2/lib/python/DocumentTemplate/DT_In.py, line 672, in renderwob (Object: Modules) File /usr/local/zope/2-2-2/lib/python/OFS/ObjectManager.py, line 601, in __getitem__ (Object: ProviderContainer) File /usr/local/zope/2-2-2/lib/python/OFS/ObjectManager.py, line 241, in _getOb (Object: ProviderContainer) TypeError: (see above)
Hi Roch,
The whole traceback would be helpful.. one clue:
Error Type: TypeError Error Value: hasattr, argument 2: expected string, int found
'hasattr' is the function that is complaining.... do you use it in your code?
-steve
"Roch'e" == Roch'e Compaan <roche@ybm.co.za> writes:
Roch'e> I have a method called getModulesForProduct to which I Roch'e> pass a ProductID eg: <dtml-in Roch'e> "Products.Modules.getModulesForProduct(this(), _, Roch'e> ProductID)" sort=name>
Roch'e> If ProductID is passed on from a form variable it works Roch'e> fine.
Roch'e> If I set the ProductID through REQUEST.set: <dtml-call Roch'e> "REQUEST.set('ProductID',_.str(Product.id))"> ,
Roch'e> I get a TypeError:
Roch'e> Error Type: TypeError Error Value: hasattr, argument 2: Roch'e> expected string, int found
Roch'e> I've been banging my head against this problem the whole Roch'e> day so help would really be appreciated.
Roch'e> Roché
Roch'e> _______________________________________________ Zope-Dev Roch'e> maillist - Zope-Dev@zope.org Roch'e> http://lists.zope.org/mailman/listinfo/zope-dev ** No Roch'e> cross posts or HTML encoding! ** (Related lists - Roch'e> http://lists.zope.org/mailman/listinfo/zope-announce Roch'e> http://lists.zope.org/mailman/listinfo/zope )