Reference to one of multiple tables

Timo <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <CADFAQULh-rjvyPe9NenZ+6R3Wu+D_uEtCwUg4N5k-x-DX2Biiw@mail.gmail.com>
I'm stuck at a part of my program, but I'm not sure if this is the right
place to ask. Excuses if it's not.

I have a DVD object which can have different statusses, like "on loan",
"sold", etc... A dvd can only have 1 status at the time, but I'm confused
about how to link it to 1 table only so I can access the correct status
with dvd.status .

Here's an example:

class DVD(SQLObject):
    status = ???? # Should be sold or onloan data
    # ... special "dvd" data

class Sold(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "sold" data

class OnLoan(SQLObject):
    dvd = ForeignKey('DVD')
    # ... special "on loan" data

Greets,
Timo

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox

_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.