@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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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,
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
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
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
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
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
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
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
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):
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
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
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.
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
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
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
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
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
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
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
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
34 matches
Mail list logo