[ZODB-Dev] RFC: deprecate transaction user and description fields in favor of extened info and simplify extended info API

Jim Fulton jim at zope.com
Thu Sep 23 11:30:08 EDT 2010


On Thu, Sep 23, 2010 at 11:15 AM, Hanno Schlichting <hanno at hannosch.eu> wrote:
> On Thu, Sep 23, 2010 at 4:24 PM, Jim Fulton <jim at zope.com> 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


More information about the ZODB-Dev mailing list