[sqlalchemy] Re: Session will not commit within a class

2009-08-05 Thread kportertx
UGGG! I have been fighting with this for a while. I never thought to just use an actual file for my db instead of using memory. I was using memory because I was only wanting to test things and didn't want to keep the data. Seems that perhaps due to cherrypy the database was being deleted. I

[sqlalchemy] Re: Session will not commit within a class

2009-08-05 Thread Gaetan de Menten
On Wed, Aug 5, 2009 at 08:16, kportertxkporte...@gmail.com wrote: O on a side note would you recommend elixir over declarative_base? The biggest difference between the two is that Elixir can generate some columns and tables for you (using common patterns). Michael Bayer probably won't

[sqlalchemy] Re: Session will not commit within a class

2009-08-05 Thread Gaetan de Menten
On Wed, Aug 5, 2009 at 08:13, kportertxkporte...@gmail.com wrote: UGGG!  I have been fighting with this for a while.  I never thought to just use an actual file for my db instead of using memory.  I was using memory because I was only wanting to test things and didn't want to keep the data.  

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread Michael Bayer
this appears to be an Elixir issue, check on their list. kportertx wrote: for some reason I cannot get my session to commit within a class Here is the error. Traceback (most recent call last): File /usr/local/lib/python2.6/dist-packages/cherrypy/ _cprequest.py, line 606, in respond

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread kportertx
I moved to elixir when declarative_base caused the exact same issue. Elixir still uses sqlalchemy's session so am I at least using the session correctly? Here is declarative_base code #!/usr/bin/env python # # #

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread Michael Bayer
kportertx wrote: I moved to elixir when declarative_base caused the exact same issue. Elixir still uses sqlalchemy's session so am I at least using the session correctly? thats unlikely. the error claims it is looking for a nonexistent table called __main__test, which is the kind of name

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread kportertx
@ Michael Bayer, Sorry forgot to post the new error from the code without elixir, also there was a problem with the session.commit statement in that last post. It was supposed to be session.commit() not session.commit. Traceback (most recent call last): File

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread Michael Bayer
kportertx wrote: @ Michael Bayer, Sorry forgot to post the new error from the code without elixir, also there was a problem with the session.commit statement in that last post. It was supposed to be session.commit() not session.commit. ok so, you called create_all() after all modules

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread kportertx
But this is all in one file, create_all() after all classes defining the model are loaded. I noticed earlier I accidentally posted the error twice, here is the source code. Could you try running this and see if you run into the same problem. Again this all one file. This is also my first week

[sqlalchemy] Re: Session will not commit within a class

2009-08-04 Thread kportertx
Could this have something to do with using a database in memory? I just noticed if I call create_all() within my class every time I want to update the database it works. Also it is able to add multiple items by pressing refresh. But when I browse away from the web page and return later it