hi there,

i'd like to add an array of 'tag' attributes for use on my orm objects
while my scripts are running (i.e. a flag to delete etc.).

recently i found that,

class Foo(object):
  tags = []

caused problems with object instances sharing the same .tags attribute
list. to ensure that a new instance was created on instantiation i
started doing,

class Foo(object):
  def __init__(self):
    self.tags = []

however the init behaviour of sqlalchemy is altered, see
http://www.sqlalchemy.org/trac/wiki/FAQ#whyisntmy__init__calledwhenIloadobjects

i realise that there is a way around this described in the sqlalchemy
faq, but since i am a relative python newbie i was wondering if there
is a better way to ensure each one of my instances has a fresh list
created?

brendan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to