Thanks Oleg
I am coverting code from sqlobject 0.6.1 to 0.7.7
and in 0.6.1 they used to have
self._SO_creating attribute which we do not have in 0.7.7
is there anything that I can use instead of _SO_creating
On 6/12/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
On Mon, Jun 11, 2007 at 04:24:11PM -0400, Stanko Petrovic wrote:
> class Testadd(so.SQLObject):
> class sqlmeta:
> style = so.MixedCaseStyle(longID=True)
> table = 'testadd'
>
> Name = so.StringCol()
> BufferSize = so.FloatCol( default = 0.0 )
>
> def _set_BufferSize(self, value):
> if value != self._SO_get_BufferSize():
> value = 1.0
> self._SO_set_BufferSize(value)
>
> def _get_BufferSize(self):
> return self._SO_get_BufferSize()
>
> t2=Testadd(Name="test6")
You are creating a new row; the row hasn't been instered yet, so it
doesn't have an id. But before setting the new value in _set_BufferSize()
you ask the database about the previous value. How can SQLObject answer
the
question without knowing the id of the row? It cannot, hence the error:
> This fails with error main.py line 1124 in set
> raise AttributeError ......
> Testadd object has no attribute 'id' (with attribute 'BufferSize')
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss