Yeah, I suppose that's the obvious solution (put them in the same file).

I tried passing a string to relation and it complained that it wasn't
expecting a string. I saw elsewhere on these posts that someone had said
that SA worked that way, but either I'm not doing it right or it really
doesn't work that way...maybe it's a bug I don't know.

On Fri, Mar 13, 2009 at 8:54 AM, Christoph Zwerschke <[email protected]> wrote:

>
> 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.
>
> Also note that SQLAlchemy allows you to pass as-yet undefined objects as
> strings.
>
> Or, you can add attribute later, after you declared both classes (e.g.
> in __init__.py, after you imported all model classes).
>
> -- Christoph
>
> >
>


-- 
Rob Neville
http://www.robneville.net

http://www.linkedin.com/in/robneville

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to