Re: New SQLAlchemy tutorial

2008-03-24 Thread Wichert Akkerman
Previously Mike Orr wrote: I've put a new SQLAlchemy tutorial in the Pylons official docs. http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons Thanks for that tutorial. I'm running into a problem with database creation though. After following all the steps in that tutorial

Re: New SQLAlchemy tutorial

2008-03-24 Thread Wichert Akkerman
Previously Wichert Akkerman wrote: Previously Mike Orr wrote: I've put a new SQLAlchemy tutorial in the Pylons official docs. http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons Thanks for that tutorial. I'm running into a problem with database creation though

Re: New SQLAlchemy tutorial

2008-02-25 Thread askel
without bind parameter once it is bound to engine. Cheers On Feb 25, 1:20 am, Mike Orr [EMAIL PROTECTED] wrote: I've put a new SQLAlchemy tutorial in the Pylons official docs.http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons It's an update of SQLAlchemy 0.4 for people

New SQLAlchemy tutorial

2008-02-24 Thread Mike Orr
I've put a new SQLAlchemy tutorial in the Pylons official docs. http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons It's an update of SQLAlchemy 0.4 for people in a hurry with the new model structure that will be in Pylons 0.9.7 (the init_model() function and 'meta' module

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-17 Thread Alexandre CONRAD
Christoph Haas wrote: Would it be wise to add a model.Session.commit() to the lib/base.py - BaseController - __after__()? I'm not using commit(), only flush(), so I can't really answer your question. But at least, __after__ would definitly be the place to put Session.remove() /

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-17 Thread Michael Bayer
On Aug 17, 7:17 am, Christoph Haas [EMAIL PROTECTED] wrote: Does that mean I still have to run Session.commit() manually after I did changes? I'm glad about the autoflush option so I don't need to flush any more. But instead it appears I need to commit() after every change. Shouldn't

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
On 8/15/07, Jose Galvez [EMAIL PROTECTED] wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with sacontext, I'm not sure how to get at it with this new setup Use Session.mapper instead of

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Jose Galvez
Ok I think I posted to soon, I needed to read the website a little more closely before firing off stupid questions. Jose Jose Galvez wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Alexandre CONRAD
Jose, Jose Galvez wrote: Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with sacontext, I'm not sure how to get at it with this new setup this could be some more ressource for you: I posted my

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Christoph Haas
On Wed, Aug 15, 2007 at 06:04:22PM -0700, Mike Orr wrote: I've updated SQLAlchemy for people in a hurry with the new SQLAlchemy 0.4 programming pattern designed by Ben, MikeB, and myself. We're no longer using SAContext but instead putting the engine, metadata, and contextual session

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
On Aug 16, 5:26 am, Christoph Haas [EMAIL PROTECTED] wrote: Worse is that I can't query for objects through paster shell. I get this exception: /home/chaas/projekte/dnsdhcp/dnsdhcp/model/__init__.py in pylons_scope() 16 import thread 17 from pylons import config --- 18

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
On Aug 16, 5:34 am, Vegard Svanberg [EMAIL PROTECTED] wrote: * Christoph Haas [EMAIL PROTECTED] [2007-08-16 11:26]: Oh, well, the whole project seems to be a increasingly moving target. First pylons.database is deprecated and replaced by SAContext. Then SAContext is deprected. Takes

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread jk
It looks like there are some issues with threading. I put the lines try: model.Session.configure(bind = g.sa_engine) return WSGIController.__call__(self, environ, start_response) finally: assert hasattr(model.Session, 'registry')

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
So it had the attribute registry right before the remove() call, but somewhere deep inside the attribute vanished. the remove() call is actually not correct in release beta2, so ive updated the article to reference beta3 and/or the current trunk. also i changed the configure call above it

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
ive released beta3 which fixes the remove() issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Jose Galvez
Well for me, I think in my production stuff I'll stick with sacontext and sqlalchemy 3x until this sorts out a little. Having said that I will play with the new stuff in a separate workingenv to get a taste of how things are going to work in the near future. What would be really nice is if

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Michael Bayer
+1 on a pylons-sqlalchemy template since if youre *really* in a hurry, thats the best --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
First, apologies for the mistakes in the tutorial. I'm going to convert my own application today, so that will be a practical test. But I did say to check back in 24 hours in case there are corrections. Let's make that 48 hours from now, to take care of any remaining beasties. On 8/16/07,

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Christoph Haas
On Thu, Aug 16, 2007 at 01:55:26PM -0700, Mike Orr wrote: First, apologies for the mistakes in the tutorial. I'm going to convert my own application today, so that will be a practical test. But I did say to check back in 24 hours in case there are corrections. Let's make that 48 hours from

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread Mike Orr
On 8/16/07, Christoph Haas [EMAIL PROTECTED] wrote: There is one problem left for me now. The code in lib/base.py doesn't seem to do its job properly: File '/home/chaas/projekte/dnsdhcp/dnsdhcp/lib/base.py', line 43 in __call__ model.Session.remove() File

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
update to beta3 plz I'm not able to install it it creates an empty directory # easy_install SQLAlchemy-0.4.0beta3.tar.gz Processing SQLAlchemy-0.4.0beta3.tar.gz Running SQLAlchemy-0.4.0beta3/setup.py -q bdist_egg --dist-dir

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
Il giorno ven, 17/08/2007 alle 01.49 +0200, xlyz ha scritto: update to beta3 plz I'm not able to install it it creates an empty directory /usr/lib/python2.5/site-packages/SQLAlchemy-0.4.0beta3-py2.5.egg never mind. it's not a directory, but a zipped file /me hides in a corner

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
You may want to check the article again in 24 hours in case SQLAlchemy experts have corrected any errors. One thing I'm adding right now is the pylons_scope function. I'm not an expert, but in your model you need to add: import pylons or you get: type 'exceptions.NameError': name 'pylons'

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-16 Thread xlyz
Il giorno ven, 17/08/2007 alle 02.34 +0200, xlyz ha scritto: You may want to check the article again in 24 hours in case SQLAlchemy experts have corrected any errors. One thing I'm adding right now is the pylons_scope function. I'm not an expert, but in your model you need to add:

New SQLAlchemy tutorial; SAContext is dead

2007-08-15 Thread Mike Orr
I've updated SQLAlchemy for people in a hurry with the new SQLAlchemy 0.4 programming pattern designed by Ben, MikeB, and myself. We're no longer using SAContext but instead putting the engine, metadata, and contextual session directly in our application code. This allows you to apply advanced

Re: New SQLAlchemy tutorial; SAContext is dead

2007-08-15 Thread Jose Galvez
Wow a lot to digest. I use assign_mapper which needs the session_context how do I get that with the the new setup? It was pretty easy to get with sacontext, I'm not sure how to get at it with this new setup Jose Mike Orr wrote: I've updated SQLAlchemy for people in a hurry with the new