Bugs item #1398848, was opened at 2006-01-07 08:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1398848&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject from repository
Status: Open
Resolution: None
Priority: 5
Submitted By: Jim Eggleston (egg2213)
Assigned to: Nobody/Anonymous (nobody)
Summary: Magic attributes not in dictionary returned by asDict()
Initial Comment:
Revision 1477: /SQLObject/trunk
'Magic' attributes created using the _get_xxx special
method are not included in the dictionary returned by
sqlmeta.asDict(). This is because the magic attributes
are not in sqlmeta.columns, which asDict uses to get
the property names.
The work around I use for now is to add the attribute
names to sqlmeta.columns explicitely. I just use a
string for the value. I have no idea what side effects
this may cause, but it makes asDict work the way i
want it to.
e.g.
class Person(SQLObject):
firstname = StringCol(length=20, default='')
lastname = StringCol(length=20, default='')
...
def _get_image(self):
...
Person.sqlmeta.columns['image'] = 'Magic attribute'
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1398848&group_id=74338
|