RE: Using SQLAlchemy with Pylons - Data queries and modifications

2009-01-06 Thread Vadim Khaskel
@googlegroups.com Subject: Re: Using SQLAlchemy with Pylons - Data queries and modifications Hello, Vadim, def loadinfo(self): mr_jones = model.Person() mr_jones.name = 'Mr Jones' model.meta.Session.save(mr_jones) model.meta.Session.commit

Re: Using SQLAlchemy with Pylons - Data queries and modifications

2009-01-05 Thread Dalius Dobravolskas
Hello, Vadim, def loadinfo(self): mr_jones = model.Person() mr_jones.name = 'Mr Jones' model.meta.Session.save(mr_jones) model.meta.Session.commit() The problem is in how you have created session. Since I don't know what's your SqlAlchemy version and how

Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Karlo Lozovina
Hi all, is this: http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons the new default, preferred way of using SQLalchemy with Pylons? It seems now I have to add something like: engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) otherwise I get errors

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Karlo Lozovina
On May 20, 11:18 am, Karlo Lozovina [EMAIL PROTECTED] wrote: the new default, preferred way of using SQLalchemy with Pylons? It seems now I have to add something like: engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) Silly me :). What I wanted to say, I have to add

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Luis Bruno
Karlo Lozovina escreveu: engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) Silly me :). What I wanted to say, I have to add that piece of code to every action of my controllers. That seems somehow redundant to me... ? I use an WSGI fake-middleware, which fires

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Kumar McMillan
Karlo Lozovina escreveu: engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) I have to add that piece of code to every action of my controllers. That seems somehow redundant to me... I also was wondering if this was the right thing to do. I solve it by putting this in

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Luis Bruno
Kumar McMillan escreveu: class BaseController(WSGIController): def __call__(self, environ, start_response): model.db.connect(config['sqlalchemy.default.uri']) try: return WSGIController.__call__(self, environ, start_response) finally:

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Kumar McMillan
On Tue, May 20, 2008 at 11:32 AM, Luis Bruno [EMAIL PROTECTED] wrote: Kumar McMillan escreveu: class BaseController(WSGIController): def __call__(self, environ, start_response): model.db.connect(config['sqlalchemy.default.uri']) try: return

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Luis Bruno
Kumar McMillan escreveu: On Tue, May 20, 2008 at 11:32 AM, Luis Bruno [EMAIL PROTECTED] wrote: I must have missed this: why connect-and-bind() on each request? because otherwise I get an error similar to above: that no engine has been defined for the current thread. Yes, I vaguely

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Mike Orr
On Tue, May 20, 2008 at 2:18 AM, Karlo Lozovina [EMAIL PROTECTED] wrote: Hi all, is this: http://wiki.pylonshq.com/display/pylonsdocs/Using+SQLAlchemy+with+Pylons the new default, preferred way of using SQLalchemy with Pylons? Yes. If you create a new app in Pylons' development version

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Luis Bruno
Mike Orr escreveu: If you create a new app in Pylons' development version, it will ask if you want SQLAlchemy, and if so it will preconfigure the model according to that article. Care to change it to a I-know-who-my-session-is model? As you can see below, the session itself doesn't need to

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Mike Orr
On Tue, May 20, 2008 at 12:42 PM, Luis Bruno [EMAIL PROTECTED] wrote: Mike Orr escreveu: If you create a new app in Pylons' development version, it will ask if you want SQLAlchemy, and if so it will preconfigure the model according to that article. Care to change it to a

Re: Default way of using SQLAlchemy with Pylons

2008-05-20 Thread Kumar McMillan
On Tue, May 20, 2008 at 2:07 PM, Mike Orr [EMAIL PROTECTED] wrote: engine = engine_from_config(config, 'sqlalchemy.') init_model(engine) This is done in environment.py, as shown in The Engine section of the article. It is not normally done in the base controller. otherwise I get errors

Re: SQLAlchemy and Pylons

2007-05-26 Thread Maciej Litwiniuk
On 23 Maj, 22:25, baus [EMAIL PROTECTED] wrote: One thing that is not mentioned in any of the tutorials that I needed get sqlalchemy to work is the following in base.py from pylons.database import make_session from pylons.database import session_context class

Re: SQLAlchemy and Pylons

2007-05-25 Thread voltron
Great stuff Mike, especially the part when you mention that pylons creates a session context, it is non obvious things like this that confuse newbies like me On May 24, 10:47 pm, Mike Orr [EMAIL PROTECTED] wrote: On 5/23/07, Qiangning Hong [EMAIL PROTECTED] wrote: On May 23, 9:58 pm,

Re: SQLAlchemy and Pylons

2007-05-24 Thread Mike Orr
On 5/23/07, Qiangning Hong [EMAIL PROTECTED] wrote: On May 23, 9:58 pm, Mike Orr [EMAIL PROTECTED] wrote: http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+peopl... Use this one. The way to set up the model is still evolving, but this is the closest to the emerging

Re: SQLAlchemy and Pylons

2007-05-24 Thread __wyatt
On May 23, 7:56 pm, Qiangning Hong [EMAIL PROTECTED] wrote: On May 23, 9:58 pm, Mike Orr [EMAIL PROTECTED] wrote: http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+peopl... Use this one. The way to set up the model is still evolving, but this is the closest to the emerging

SQLAlchemy and Pylons

2007-05-23 Thread voltron
What is the recommend usage of SQLAlchemy and Pylons? I found these links, what is preffered? http://www.rexx.com/~dkuhlman/pylons_quick_site.html#database-access-using-a-data-model http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+people+in+a+hurry Thanks

Re: SQLAlchemy and Pylons

2007-05-23 Thread voltron
Now my head is spinning, I read the SQLAlchemy docs: http://www.sqlalchemy.org/docs/tutorial.html#tutorial_orm And its approach is also different --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss

Re: SQLAlchemy and Pylons

2007-05-23 Thread Christoph Haas
On Wed, May 23, 2007 at 12:14:34AM -0700, voltron wrote: What is the recommend usage of SQLAlchemy and Pylons? I found these links, what is preffered? http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+people+in+a+hurry I'm using this (^^^) approach. The only drawback

Re: SQLAlchemy and Pylons

2007-05-23 Thread Mike Orr
On 5/23/07, voltron [EMAIL PROTECTED] wrote: What is the recommend usage of SQLAlchemy and Pylons? I found these links, what is preffered? See my message yesterday, subject SQLAlchemy model. The steps are clear: you need an engine, metadata, and tables (explicitly defined or autoloaded

Re: SQLAlchemy and Pylons

2007-05-23 Thread voltron
Thank you both for the heads up --~--~-~--~~~---~--~~ 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 this group, send email

Re: SQLAlchemy and Pylons

2007-05-23 Thread baus
One thing that is not mentioned in any of the tutorials that I needed get sqlalchemy to work is the following in base.py from pylons.database import make_session from pylons.database import session_context class BaseController(WSGIController): def __call__(self, environ, start_response):

Re: SQLAlchemy and Pylons

2007-05-23 Thread baus
I found the need to this a bit disconcerting in that I really don't understand why it is necessary. I wish somebody could explain it to me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups pylons-discuss group. To

Re: SQLAlchemy and Pylons

2007-05-23 Thread Qiangning Hong
On May 23, 9:58 pm, Mike Orr [EMAIL PROTECTED] wrote: http://docs.pythonweb.org/display/pylonscookbook/SQLAlchemy+for+peopl... Use this one. The way to set up the model is still evolving, but this is the closest to the emerging standard. Could you please give some talk or resources about

Re: SQLAlchemy and Pylons

2007-05-23 Thread Ben Bangert
baus wrote: I found the need to this a bit disconcerting in that I really don't understand why it is necessary. I wish somebody could explain it to me. SQLAlchemy has a session context, which tracks objects that have been loaded from the database, modifications to them, and pending changes.

Re: Durus vs. SQLAlchemy (was: Pylons and Durus)

2006-10-17 Thread Bruno Desthuilliers
Shannon -jj Behrens wrote: Slightly off topic: OR mappers like SQLAlchemy have come a long way in recent years. They've made it a lot easier to use RDBMSs without writing SQL, etc. Since the benefits of an RDBMS such as on-the-server queries are so great, and since the drawbacks are now

Re: Durus vs. SQLAlchemy (was: Pylons and Durus)

2006-10-16 Thread Eric Wolls
Dear jj, I don't have much explanation to offer except for my mere curiosity in playing with an object database. I actually love working with SQL and have done so for a few years. As I said before, this is driven mostly by a desire to learn more. Or hacking curiosity if you will. : ) eric

Re: Using SQLAlchemy with Pylons

2006-10-15 Thread Shannon -jj Behrens
On 10/14/06, Huy Do [EMAIL PROTECTED] wrote: Shannon -jj Behrens wrote: On 10/13/06, Huy [EMAIL PROTECTED] wrote: Shannon -jj Behrens wrote: I've added my notes to the wiki after incorporating all of your feedback: Using SQLAlchemy with Pylons: http://pylonshq.com/project

Re: Using SQLAlchemy with Pylons

2006-10-14 Thread Huy Do
Shannon -jj Behrens wrote: On 10/13/06, Huy [EMAIL PROTECTED] wrote: Shannon -jj Behrens wrote: I've added my notes to the wiki after incorporating all of your feedback: Using SQLAlchemy with Pylons: http://pylonshq.com/project/pylonshq/wiki/SqlAlchemyWithPylons If you update

Re: Using SQLAlchemy with Pylons

2006-10-13 Thread Shannon -jj Behrens
On 10/13/06, climbus [EMAIL PROTECTED] wrote: Shannon -jj Behrens napisal(a): I've added my notes to the wiki after incorporating all of your feedback: Using SQLAlchemy with Pylons: http://pylonshq.com/project/pylonshq/wiki/SqlAlchemyWithPylons If you update it, please send email

Using SQLAlchemy with Pylons

2006-10-10 Thread Shannon -jj Behrens
I've added my notes to the wiki after incorporating all of your feedback: Using SQLAlchemy with Pylons: http://pylonshq.com/project/pylonshq/wiki/SqlAlchemyWithPylons If you update it, please send email to this list so that the rest of us can benefit from your improvements. Best Regards, -jj

Re: Using SQLAlchemy with Pylons

2006-10-06 Thread Joe
Hi jj, On Fri, 2006-10-06 at 14:51 -0700, Shannon -jj Behrens wrote: Ok, that's it. I think we should make sure that people like Ben Bangert and Mike Bayer agree with my recommendations, and then perhaps we can update the wiki tutorial. The person who wrote the tutorial was James Gardner

Re: Using SQLAlchemy with Pylons

2006-10-06 Thread Shannon -jj Behrens
On 10/6/06, Joe [EMAIL PROTECTED] wrote: Hi jj, On Fri, 2006-10-06 at 14:51 -0700, Shannon -jj Behrens wrote: Ok, that's it. I think we should make sure that people like Ben Bangert and Mike Bayer agree with my recommendations, and then perhaps we can update the wiki tutorial. The