On Thu, Dec 11, 2003 at 05:26:56PM -0600, Ken Kinder wrote:
| 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?
This has been asked in the list around two months ago. Search the archives.
--
Sidnei da Silva <si...@aw...>
http://awkly.org - dreamcatching :: making your dreams come true
http://plone.org/about/team#dreamcatcher
All language designers are arrogant. Goes with the territory...
-- Larry Wall
|