March 11, 2008

web2py interactive database sessions

Filed under: dev, python, web2py — michaelangela @ 1:12 am

After some experimentation, at least with the way I am working with web2py’s orm, the migrate command causes problems from an interactive shell session, i.e. within iPython.

So instead of


I have to use

migrate=’some_file.table’ if request.env else False

That’s no so bad. Previously I thought I would have to use

migrate=’some_file.table’ if __name__==’__builtin__’ else False

I didn’t like that. There may be another way but this is pretty clean and consistent for now. It also means I can combine ORMs with web2py’s orm now.


1 Comment »

  1. Hi.
    It appears as if you are an expert in the use of Web2Py.
    I am a second year Engineering student and I am doing a project in Web2py.
    You could be a genuine help to me.
    Kindly respond to me on meetmanannayak@gmail.com so that I can get in touch with you.

    Comment by sidjustice21 — October 18, 2008 @ 7:54 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: