[Zope3-Users] OOBTree instances lose attributes upon restart
Hi everyone. I've been fighting with this for a while now. So I mail the list for a suggestion. I have a `Variable` class wich I subclass from OOBTree, because I need a dictionary with the min, max options that OOBTree methods give. My object is supposed to store datetime.datetime instances as keys and floats numbers as values. eg: temperature[datetime(2007, 4, 6, 12, 8)] = 25.8 I didn't use BTreeContainer because only takes strings as keys, and I don't want to map datetime to strings and back. Here's my class definition: class Variable(OOBTree, Contained): implements(IVariable, IAttributeAnnotatable) name = None units = None I start the server and everything works like a charm. My AddForm works OK for the Variable class. I checked its create() method (with assert statements) and the returned instances contain the name and units attributes set from the form. But if I stop the server and restart later, my data (datetimes and floats) are still there, but my name and units attributes are None!! I tried to subclass from (OOBTree, Persistent, Contained) too, and it didn't work either. If I subclass only from (PersistentDict) everything works. Data and attributes are mantained upon restart, but I lose the min, max functionality I like :( What could be the problem or a possible solution to this issue? Thanks. Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/ ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Default value for an interface attribute
Hi everybody. I have this interface: class INews(IPage): A news page for the application. date = Date( title=_(uPublication Date), description=_(uThe intended date for this news), default=date.today(), required=False ) My problem is that I started the instance on February 21, and when I use an AddForm for this interface, my form shows that date instead of today's date, which is what I need. It seems like the default attribute is set once upon server start and then never changed. Is that the case? If it is, could you please point me to a better approach for this? Thanks. Want to start your own business? Learn how on Yahoo! Small Business. http://smallbusiness.yahoo.com/r-index ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Default value for an interface attribute
--- Raphael Ritz [EMAIL PROTECTED] wrote: How about checking whether the value of 'default' is a callable and if so call it to obtain the default value. That way defautl=date.today (without the ())should do what Douglas expects (maybe this is even the case already?). I tried this way, but raises this Exception: ConfigurationError: ('Invalid value for', 'interface', (built-in method today of type object at 0xb79465c0, type 'datetime.date')) Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Which packages to remove from etc/package-includes
Hi everybody. I know a similar question was already post here: http://mail.zope.org/pipermail/zope3-users/2005-October/001142.html But I didn't understood well Stephan's answer (sorry!). I think I'm looking for a solution like Garrett's (though it wasn't specific). I'm just wondering which *-configure.zcml or *-meta.zcml files can be removed from the etc/package-includes dir of an instance in order to get running the minimum Zope3 but in a stable way. For example, I know my application won't be using any sql related stuff, so I think is possible to remove the sqlscript-configure.zcml file. I believe the less *-configure.zcml and *-meta.zcml files are in this directory the faster Zope3 loads, right? But if I remove every file except the apidoc related, then Zope3 won't even start because it complains about preference-*.zcml files. I got Zope3 running again testing and reading error messages (just like Garrett suggests), but I think this way could be dangerous in case I miss something important. Is this issue important or there's no real difference in how many packages get included on start? Thanks. __ Yahoo! for Good - Make a difference this year. http://brand.yahoo.com/cybergivingweek2005/ ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users