option 1) You can code the script as if it where code inside a
controller and run it with

python web2py.py -S appname -M -R yourscript.py

option 2)

from gluon.shell import exec_environment
env=exec_environment('the_model_file.py')

env.db contains the database, env.db.tables, the list of tables etc
etc. (assuming the db is called "db")

Massimo


On Jan 23, 9:42 am, BearXu <[email protected]> wrote:
> I want to write a script using web2py's database but outside the web2py
> environment.
>
> I have searched for the mails previous that I need to write db.definetable
> again plus migrate = false
> Do we have a more easy way like the script can reuse the code in
> models/db.py?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to