Hi Folks, I've got a Product I've been working on... it works great on 1.9.0, but I just tried running it under 1.10.2 and I get the following error... (on both ZServer, and ZopeHTTPServer): <html> <head> <title>exceptions.AttributeError</title> </head> <body> Sorry, an error occurred.<p> <!-- Traceback (innermost last): File /usr/local/etc/Zope-1.10.2-src/lib/python/ZPublisher/Publish.py, line 877, in publish_module File /usr/local/etc/Zope-1.10.2-src/lib/python/ZPublisher/Publish.py, line 590, in publish (Info: /manage_addEMarket) File /usr/local/etc/Zope-1.10.2-src/lib/python/Products/EMarket/EMarket.py, line 82, in addEMarket (Object: ApplicationDefaultPermissions) File /usr/local/etc/Zope-1.10.2-src/lib/python/OFS/PropertyManager.py, line 245, in manage_addProperty (Object: Navigation) File /usr/local/etc/Zope-1.10.2-src/lib/python/OFS/PropertyManager.py, line 184, in _setProperty (Object: Navigation) File /usr/local/etc/Zope-1.10.2-src/lib/python/OFS/PropertyManager.py, line 163, in valid_property_id (Object: Navigation) AttributeError: aq_base --> </body> </html> ---------------------------------------------------------------------- So it's something to do with my setting a property of a folder... I check my code newMainF = EMarket() # EMarket is a subclass of folder..... newMainF.id = id newMainF.title = title newMainF.manage_addProperty( 'RegistrationSubject', "Registration Information", 'string') newMainF.manage_addProperty( 'RegistrationFrom', "manager@" + gethostname(), 'string') self._setObject(id, newMainF) OK... I comment out the "manage_addProperty" and it works (except the properties are not defined now!). From the error it sounds like RegistrationSubject is illegal as a property name....but if I add such a property to a folder by 'hand' it works fine. Any ideas? thanks, -steve
"Steve" == Steve Spicklemire <steve> writes:
Steve> Hi Folks, Steve> [Problem with manage_addProperty deleted...] OK .. I've make an obvious workaround to my problem with manage_addProperty Steve> So it's something to do with my setting a property of a folder... I check my code the original code.... in manage_addEMarket(): newMainF = EMarket() # EMarket is a subclass of folder..... newMainF.id = id newMainF.title = title newMainF.manage_addProperty( 'RegistrationSubject', "Registration Information", 'string') newMainF.manage_addProperty( 'RegistrationFrom', "manager@" + gethostname(), 'string') self._setObject(id, newMainF) This broke because for some reasy the EMarket instance didn't have an aq_base defined until later (I could add the property by hand later and it was OK.) to keep working I changed the EMarket class to be: ---------------------------------------------------------------------- class EMarket(OFS.Folder.Folder): """An EMarket class. Provide the functions needed to contain an online shopping area. """ # Specify a name for the item type: meta_type='EMarket' id ='emarket' title ='EMarket Object' icon ='misc_/EMarket/emarket' RegistrationSubject = 'Registration Information' RegistrationFrom = 'manager@' + defaulthost _properties=({'id':'title', 'type': 'string', 'mode':'w'}, {'id':'RegistrationSubject', 'type':'string', 'mode':'w'}, {'id':'RegistrationFrom', 'type':'string', 'mode':'w'}, ) ---------------------------------------------------------------------- Not quite as obvious... but at least it works with 1.10.2! I'll post the whole spiel soon... -steve
participants (1)
-
Steve Spicklemire