[SQLObject] Re: SQLObject inheritance patch 2
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: Daniel S. <sa...@gn...> - 2004-02-12 13:48:36
|
Hello Oleg,
I sent you a little test (your test with very smalls modifications)
and the complete SQLObject.py file patched with my patch.
It is not needed to create and drop table each time. Only to be
sure they are created.
Can you try it and tell me if its works now ?
As for assigning the _parent variable only in new, it is needed
because we must link to the true instance of the parent class at this
time to be able to get the good properties.
thanks,
Daniel Savard
Oleg Broytmann wrote:
>On Wed, Feb 11, 2004 at 10:40:31PM -0500, Daniel Savard wrote:
>
>
>> I tried your test with MySQL and PostGreSQL under Python 2.2.3 and
>>2.3.3 and it worked well.
>> What database are you using ?
>>
>>
>
> Python 2.3.3, Postgres, SQLObject 0.5.1 with your patch.
>
>
>> Did you create the table (createTable method) ?
>>
>>
>
> But of course! :)
>
>
>> You should add theses two lines after class creation:
>>Woman.createTable(1)
>>Wilma.createTable(1)
>>
>>
>
> I did it this way:
>
>Woman.dropTable(ifExists=True)
>Woman.createTable()
>
>Wilma.dropTable(ifExists=True)
>Wilma.createTable()
>
> Of course I do not do it on every invocation of the program.
>
>
>
>> I tried your sample without creating the table and get the same
>>problem as your.
>> Adding theses two lines just after the class creation corrected it.
>>
>>
>
> Still don't work. Well, at least I know it is possible.
>
> Where the _parent attribute should be created? May be I applied the
>patch wrong way (though I didn't see any errors/rejects).
>
>Oleg.
>
>
|