I have an employees table and a departments table, and every employee
has a foreign key to the departments table.
99% of the time, new employees belong to one particular department,
"SALES".
How can I make the SALES department the default department for new
employees?
I tried this:
class Department(SQLObject):
name = UnicodeCol(alternateID=True)
class Employee(SQLObject):
user_name = UnicodeCol(alternateID=True)
department = ForeignKey(default=Department.byName("SALES")
And it failed.
Any ideas?
Thanks in advance.
Matt
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss