Hi,
I want to define a set of common attributes for my tables, without the
need to define them redundantly in the SQLObject classes.
I've read http://www.sqlobject.org/Inheritance.html but I want single
flat simple Tables without complicated and slow Joins in the database.
For example I want the following database schema (pseudo code):
table Professor:
name String
timetable String
table Student:
name String
year String
I don't want to define the name attribute in every single SQLObject class.
I came up with a solution:
class Person(SQLObject):
name = StringCol()
class Professor(Person, SQLObject):
timetable = StringCol()
class Student(Person, SQLObject):
year = StringCol()
This seems to work, except that the Person table is also created
unnecessarily when the model is created (using TurboGears)
Is there a solution?
--
Greg
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss