=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hi,
some time ago there was a thread on this mailinglist, about overiding the=20
new() method in classes inherited from SQLObject.
(http://thread.gmane.org/gmane.comp.python.sqlobject/906)
according to a posting in this thread it is possible to call the 'original'=
=20
SQLObject new() method by: 'SQLObject.new(cls, **kw)'.
but somehow this doesn't work for me :/
class Account(SQLObject):
__name =3D StringCol(alternateID =3D True)
__password =3D StringCol()
__def new(cls, **kw):
____print "FOO"
____SQLObject.new(cls, **kw)
__new =3D classmethod(new)
calling Account.new just results in the following exception when SQLObject.=
new=20
gets called:
TypeError: new() takes exactly 1 non-keyword argument (2 given)
i tried some variantions of calling SQLObject.new (e.g. without cls, ...) b=
ut=20
they didn't work.
any ideas how it is possible to call SQLObject.new?
(i need to override new, because i want to crypt the password before storin=
g=20
it. part of the username is used as salt by the algorithm which i have to u=
se=20
(because it is used by the XUF zope user folder), so i need to know both=20
values at the same time to crypt the password).
cu
/gst
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/3YxtZtF7I/+gjcERAmZVAJsHV7pCo81EfTNOdy3p9OcZfCCqMQCfXOvJ
HthMCSGEiQLLilQa1Om2rNE=3D
=3DkX5h
=2D----END PGP SIGNATURE-----
|