Christoph Zwerschke schrieb:
> robneville73 schrieb:
>> I have a model called Customer and a model called Order. Order is a
>> child of Customer (1 Customer : N Order).
>
> Just as an aside, I would not call a single class a "model". The model
> is the whole collection of your database objects and their relations.
>
>> OK, maybe this is a short way of saying it:
>> How do I reference methods from other models inside of a model without
>> creating this import dependency issue?
>
> I recommend defining related model classes inside the same module
That's not working.
class Foo(object):
some_attribute = Bar() # bails out
class Bar(object):
other_attribute = Foo()
Define them after both classes are known (which arguably is easier in
one module of course), or use Strings - at least Elixir allows that.
class Foo(Entity):
bars = OneToMany("Bar")
class Bar(Entity):
foo = ManyToOne("Foo")
Diez
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---