I'm having a bit of confusion here. It seems that if you instanciate a
SQLObject with a string, and another with an int, even of those are the
same row, they are not evaluated as being the same object. Example code:
>>> class MyClass(SQLObject):
... field = StringCol(length=20)
...
>>> MyClass.createTable()
>>> MyClass.new(field='spam')
<MyClass 1 field='spam'>
>>> MyClass.new(field='eggs')
<MyClass 2 field='eggs'>
>>> spam = MyClass(1)
>>> spam2 = MyClass('1')
>>> spam2 is spam
False
Shouldn't SQLObject know to cast the id to an int?
Thanks
Ken
|