Good point, somehow I forgot about that. Actually
polymorphic inheritance is very simple, here's a
small example:

import sqlalchemy

from turboentity import *
from turboentity import objectstore

metadata = sqlalchemy.BoundMetaData("sqlite:///:memory:", True)

class Employee (Entity):
    name = Column(Unicode(30))

class Engineer (Employee):
    engineer_info = Column(Unicode(60))

class Marketer (Employee):
    marketer_info = Column(Unicode(60))

create_all()

worker = Employee(name="Some Worker")
engineer = Engineer(name="Joe Engineer", engineer_info="joe's an
engineer")
marketer = Marketer(name="Pete Marketer", marketer_info="pete's a
marketer")

objectstore.flush()
objectstore.clear()

print Employee.get_by(Employee.c.name.like("Joe%")).name
print Employee.get_by(Employee.c.name.like("%Worker")).name

print Employee.get_by(Employee.c.name.like("Joe%")).engineer_info
print type(Employee.get_by(Employee.c.name.like("Pete%"))).__name__

---------------- 8< ----------------

I just found that there is a problem with inheritance
and relationships. I'm sure it worked before, I'll
investigate that soon.

Daniel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to