|
From: Nick <ni...@dd...> - 2003-04-29 19:22:03
|
On Tue, 2003-04-29 at 14:01, Luke Opperman wrote:
> ------ Person.py
> class Person(SQLObject):
> _columns = [StringCol(\'name\')]
> _joins = [MultipleJoin(\'Cat\')]
>
> ------ Cat.py
> class Cat(SQLObject):
> _columns = [StringCol('name'), KeyCol('person_id',
> foreignKey='Person')]
Stick these in a package, MyDB with the lines in __init__:
from Person import Person
from Cat import Cat
> from Person import Person
to:
from MyDB import Person
> peep = Person(1)
> for cat in peep.cats: # error because Cat has not been imported.
> print cat
Problem solved, because Cat has been imported through the package.
Nick
|