On Sat, Feb 04, 2006 at 04:08:55PM -0800, Al Pacifico wrote:
> I'm new to SQLObject...

   Welcome!

> Expanding on the second inheritance scheme advanced by
> Daniel Savard in
> http://sqlobject.org/Inheritance.html...
> 
> Consider the following:
> 
> from sqlobject.inheritance import InheritableSQLObject
> class Person(InheritableSQLObject):
>     firstName = StringCol()
>     lastName = StringCol()
> 
> class Employee(Person):
>     _inheritable = False
>     position = StringCol()
> 
> class Consultant(Person):
>     _inheritable = False
>     assignment = StringCol()
> 
> What code would I use to change an entry in the person
> table from a consultant to an employee without
> altering the id field in the table (the oen implied by
> use of the database)?

   This kind of inheritance is not your best friend if you are going to
change the identity often. You can do person.childName = "consultant" but
I'd like to recommend againts it and instead to redesign the DB scheme.

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: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to