Re: [ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API
On Thu, Sep 23, 2010 at 10:53:03AM -0400, Stephan Richter wrote: > On Thursday, September 23, 2010, Jim Fulton wrote: > > Comments? > > Sounds good and addresses my concerns raised in the discussion of the bug. What bug? Marius Gedminas -- Being really good at C++ is like being really good at using rocks to sharpen sticks. -- Thant Tessman signature.asc Description: Digital signature ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API
On Thu, Sep 23, 2010 at 11:15 AM, Hanno Schlichting wrote: > On Thu, Sep 23, 2010 at 4:24 PM, Jim Fulton wrote: >> The user and description fields are somewhat archaic. They can only be >> strings (not unicode) and can as easily be handled as extended info. >> >> I propose to deprecate the 'user' and 'description' attributes, and >> the 'setUser' and 'note' methods and to add a new 'info' attribute >> whose attributes can be set to set extended info. For example: >> >> transaction.info.user = u'j1m' > > Is this supposed to be extensible in the sense of allowing arbitrary > information? This is just syntactic sugar on the existing interface which allows named picklable values. Also note that storages may limit the amount of extended info they're willing to store. > > In that case I'd prefer this to have a dictionary spelling of: > > transaction.info[u'user'] = u'j1m' I don't like this syntactically, but I agree that it would be useful to be able to use dictionary methods. More importantly, to me at least, it should be possible to use dotted names. Currently keys/names are restricted to strings I suppose that restriction isn't necessary. So, +1 on simply implementing the info attribute as a dict. Jim -- Jim Fulton ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API
On Thu, Sep 23, 2010 at 4:24 PM, Jim Fulton wrote: > The user and description fields are somewhat archaic. They can only be > strings (not unicode) and can as easily be handled as extended info. > > I propose to deprecate the 'user' and 'description' attributes, and > the 'setUser' and 'note' methods and to add a new 'info' attribute > whose attributes can be set to set extended info. For example: > > transaction.info.user = u'j1m' Is this supposed to be extensible in the sense of allowing arbitrary information? In that case I'd prefer this to have a dictionary spelling of: transaction.info[u'user'] = u'j1m' That would make it easier to look up all available keys and values in the info attribute. Hanno ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API
On Thursday, September 23, 2010, Jim Fulton wrote: > Comments? Sounds good and addresses my concerns raised in the discussion of the bug. Regards, Stephan -- Entrepreneur and Software Geek Google me. "Zope Stephan Richter" ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
[ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API
The user and description fields are somewhat archaic. They can only be strings (not unicode) and can as easily be handled as extended info. I propose to deprecate the 'user' and 'description' attributes, and the 'setUser' and 'note' methods and to add a new 'info' attribute whose attributes can be set to set extended info. For example: transaction.info.user = u'j1m' I propose to do this in 3 phases (version numbers are guesses :): - In transaction 2.0, implement 'info' and reimplement 'user', 'description', 'note' and 'setUser' in terms of 'info'. - In transaction 2.1, add deprecation warnings for 'user', 'description', 'note' and 'setUser'. - In some future version of ZODB, stop storing user and description fields. Comments? Jim -- Jim Fulton ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev