How do I move the [root]/registration/controller and [root]/registration/model to [root]/controllers/registration(controller) and [root]/model/registration(model)

1 view
Skip to first unread message

Mike

unread,
Feb 2, 2009, 12:22:14 PM2/2/09
to tg-registration
I've attempted to move the various components of 'registration' into
'standard' controller/model sub folders (to organize a larger project
a bit better).

I've cleaned up references no problem. But I get an error when
running:

python start-myproject.py

I get there error:

File "/usr/local/src/MyProject/myproject/model/registration.py",
line 7, in <module>
from registration.ormmanager import count
ImportError: No module named ormmanager

I still have a directory called '[root/myproject]/registration with
'__init__.py' file in it. I thought, this'd work.

Anyone have any thoughts on how to get 'registration' to load so I can
reference 'ormmanager'??

Some environment info:

registration-0.50-py2.5
SQLObject-0.10.4-py2.5

Patrick Lewis

unread,
Feb 2, 2009, 3:22:16 PM2/2/09
to tg-registration
There are two parts of the tg-registration:
1) there is some code generation that occurs and lives in your tg
project. You've moved this around, and that's cool.
2) some code that lives outside your project in your Python
installation's site-package directory. This is where the ormmanager
stuff lives.

So, outside of your project, you should be able to start up the Python
interpreter and do :

>>> from registration import ormmanager

and it should just work without an ImportError, as it is importing
from site-packages. So, if that doesn't work, see if registration is
in site-packages, and that site-packages is in sys.path. Copying to a
different machine, or mucking with virtualenv could also make the
template generation work, but then later making the ormmangar
unavailable.

Hope that gives you somewhere to start.
Reply all
Reply to author
Forward
0 new messages