Re: [SQLObject] is SQLObject.new() gone?
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Michel T. <mic...@ya...> - 2004-11-28 01:27:51
|
Hi Paul If you are using 0.6 version, you should override the "_create" method. I.E.: def _create(self, id, **kw): content=kw.pop('content') SQLObject._create(self, id, **kw) self.content=content --- paul kölle <pa...@su...> escreveu: > Hi, > > following this tread: > http://sourceforge.net/mailarchive/forum.php?forum_id=30269&style=flat&viewday=15&viewmonth=200312 > > I did override the new method of my classes to set up attributes > beforehand like so: > > def new(cls, **kw): > dostuff_here() > .... > return super(MyClass, cls).new(**kw) > > new = classmethod(new) > > Having upgraded python (from 2.2 to 2.3) and probably sqlobject (not > sure cause I used svn before... now its what gentoo calls 0.6) the > above > broke my app. > > File "/mnt/data/projects/pki/certs.py", line 189, in new > obj = super(CertItem, cls).new(**kw) > AttributeError: 'super' object has no attribute 'new > > It looks like the SQLObject class has no new() method anymore ;(. Is > there a way to get this functionality back? Do I have to override > __init__ now? (I recall having read to not doing so, but it seems > natural since instances are now created like inst = SQLObject(**kw)) > > thanks > Paul > ' > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > > http://productguide.itmanagersjournal.com/ > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss > ===== -- Michel Thadeu Sabchuk Curitiba/PR _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/ |