I answer myself:

----
#!/usr/local/bin/python2.4

from bolsa.websetup import *

setup_config('', '/path_to_your_apps/myapp/development.ini', '', '')

import myapp.model as model

q = model.Session.query(model.MyClass)
# ... do whatever yo want
model.Session.commit()
-----

and don't forget to set your PYTHONPATH env variable to
'/path_to_your_apps/myapp'

Nacho

2007/9/5, neich <[EMAIL PROTECTED]>:
> Hi,
>
> I am playing with the pylons framework and I have found something I
> don't know how to do it. I would like  to write a python script that
> can access the models of my app, by I want to execute directly, not
> through a controller. For example, I would like to have a crontab
> process that perform some peridocal operations on my databse.
>
> I have tried some "Import" combinations, but I have not managed to do
> it.
>
> Any hint ?
>
> Thanks
> Nacho
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to