-
Example Model
- class Person(SQLObject):
- name = UnicodeCol(notNone=True, alternateID=True)
- presenting = MultipleJoin('Session')
- attending = RelatedJoin('Session')
-
- class Session(SQLObject):
- topic = UnicodeCol(notNone=True, alternateID=True)
- presenter = ForeignKey('Person')
- attendees = RelatedJoin('Person')
-
Manipulating the model
- $ tg-admin shell
- >>> me = Person(name='lmacken')
- >>> tgsession = Session(topic='TurboGears', presenter=me)
- >>> you = Person(name='Random Hacker')
- >>> tgsession.addPerson(you)