Assuming that "application.ini" defines all your settings for your pyramid
app...
one way that could work for you is this....
from paste.deploy import loadapp
import os
here = os.getcwd()
app = loadapp("config:application.ini", relative_to=here)
at this point any initialization that was needed should be done. you should
be able to do things like import your models and perform queries and such
from myapplication.model import User, DBSession
[u.email for u in DBSession().query(User)]
This assumes your models are defined in model.py and youre session factory
is named DBSession
or to get your resource root assuming its defined in resource.py as Root and
this is what's passed to the configurator as the root_factory
from myapplication.resource import Root
root = Root()
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/pylons-discuss/-/VK2XlHpsgg8J.
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/pylons-discuss?hl=en.