Importing multiple model modules

3 views
Skip to first unread message

Garrett

unread,
Oct 28, 2005, 11:00:23 AM10/28/05
to TurboGears
I'm trying to import into model.py several modules, all located in the
project package. I'm trying both class imports and package imports:

import user

as well as

from user import User

When I run tg-admin create sql, I'm getting:

...
No classes found!
No modules specified
No packages specified
Looked in eqqs: a2

The Getting Starting guide talks about being able to import into
model.py, but I'm having a heck of a time actually doing it.

-- Garrett

Garrett

unread,
Oct 28, 2005, 12:14:43 PM10/28/05
to TurboGears
Here's an update. I think the Getting Started guide might be wrong on
the ability to import other sql object classes as a way to distribute
the model classes to other modules.

>From the SQLObject docs:
"""When finding SQLObject classes, we look in the modules for classes
that belong to the module -- so if you import a class from another
module it won't be "matched". You have to indicate its original
module."""

So, I added the modules to the egg info in sqlobjects.txt:

db_modules=foo.bar,baz.bam

and tq-admin sql create was able to find them.

Kevin Dangoor

unread,
Oct 28, 2005, 3:15:01 PM10/28/05
to turbo...@googlegroups.com
On 10/28/05, Garrett <gar...@mojave-corp.com> wrote:
>
> Here's an update. I think the Getting Started guide might be wrong on
> the ability to import other sql object classes as a way to distribute
> the model classes to other modules.

Ick... That's certainly not the behavior I want.

Would you mind opening a ticket on that?

http://trac.turbogears.org/turbogears/newticket

Kevin
Reply all
Reply to author
Forward
0 new messages