Hi:
I'm trying to use my SQLObject model outside of TG using the guidelines
at http://docs.turbogears.org/1.0/ModelOutsideTG.
Here is the code I'm trying:
_____________________________________________
import turbogears
turbogears.update_config(configfile='c:/pywork/turbogears/motion/motion/dev.cfg',
modulename='motion.config')
from myapp.model import *
s = model.User.select()
for x in s:
print x.display_name
______________________________________________
I'm getting the following exception:
______________________________________________
Traceback (most recent call last):
File "C:\PyWork\Scripts\Rail\outside.py", line 2, in ?
turbogears.update_config(configfile='c:/pywork/turbogears/motion/motion/dev.cfg',
modulename='motion.config')
File
"C:\Python24\lib\site-packages\turbogears-1.0.1-py2.4.egg\turbogears\config.py",
line 206, in update_config
configdict = config_obj(configfile, modulename).dict()
File
"C:\Python24\lib\site-packages\turbogears-1.0.1-py2.4.egg\turbogears\config.py",
line 169, in config_obj
modname + ".cfg")
File
"C:\Python24\lib\site-packages\setuptools-0.6c3-py2.4.egg\pkg_resources.py",
line 799, in resource_filename
return get_provider(package_or_requirement).get_resource_filename(
File
"C:\Python24\lib\site-packages\setuptools-0.6c3-py2.4.egg\pkg_resources.py",
line 119, in get_provider
__import__(moduleOrReq)
ImportError: No module named motion
______________________________________________
Obviously I'm having trouble specifying the path to the motion module.
My little sample pgm is not in the TG project path. In the how-to
referenced above, it says:
"If you want the script to be able to run from any directory, you will
have to provide a full path to your configuration and set your
PYTHONPATH so that the model import succeeds."
How do I provide the full path to my config and what path do I need to
set in my PYTHONPATH?
Any help would be appreciated.
-Jim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---