Hi All,
I'm looking for examples of MapperExtensions.
Specifically, I'm looking to implement one that creates new rows when
certain attributes of an object changes.
I'm not sure if this is the right approach, so here's some pseudocode of
how I'd like to use the end result:
class
Just bumped into these questions which I still don't understand :-S
Chris Withers wrote:
I use setup/teardowns like this for this purpose (assume
scoped_session, which yes you should probably use all the time so that
the session is accessed by a single reference):
Where do you actually
Michael Bayer wrote:
We have engines set up like:
engine1 = create_engine('mysql://username:passw...@server/db1')
engine2 = create_engine('mysql://username:passw...@server/db2')
..and then have them bound to separate sessions, with separate model classes
mapped to them.
Now, mysql supports
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers
Sent: 29 June 2010 10:28
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] cross-database joins with MySQL
Michael Bayer wrote:
We have engines set up
Hi All,
Is it legit/okay/bad to do things in a MapperExtension's before_insert
and/or before_update methods?
Specifically, the following:
- change the primary key of the instance by deleting it so that the
dataabse assigns a new primary key?
- do a query to update an existing row? (where
The following code (if you replace the uri with a working one) raises
an error when run against an MSSQL db, but not against Sqlite.
I'm trying to get the same schema (which uses MSUniqueIdentifer) to
run against MSSQL and Sqlite.
Any help on fixing this is gratefully received, as I'm at a
Hi,
i m a developer with some experience in python and django - a
framework i realy like. However, i just read the sqlalchemy docu and i
think the orm seems to be really professional.
Is sqlalchemy the most prominent orm for python? Is it suitable to
write larger enterprise applications? Are
Dan @ Austria wrote:
Is sqlalchemy the most prominent orm for python?
yes.
Is it suitable to
write larger enterprise applications?
yes.
Are there any drawbacks to
sqlalchemy?
sure, as with any piece of software...
Are there any other big orm projects for python, which one
should
On Jun 29, 2010, at 7:46 AM, Chris Withers wrote:
Hi All,
Is it legit/okay/bad to do things in a MapperExtension's before_insert and/or
before_update methods?
Specifically, the following:
- change the primary key of the instance by deleting it so that the dataabse
assigns a new
On Jun 29, 2010, at 9:12 AM, Ed Singleton wrote:
The following code (if you replace the uri with a working one) raises an
error when run against an MSSQL db, but not against Sqlite.
I'm trying to get the same schema (which uses MSUniqueIdentifer) to run
against MSSQL and Sqlite.
Any
theres a nesting behavior to transactions, which is illustrated here:
http://www.sqlalchemy.org/docs/dbengine.html#using-transactions-with-connection
the setup/teardown thing I illustrated uses this functionality with a Session,
so that the Session isn't actually committing the real
Michael Bayer wrote:
Specifically, the following:
- change the primary key of the instance by deleting it so that the dataabse
assigns a new primary key?
that wont work. you need to take the object and call make_transient() on it, re-add it to the session.
Where is make_transient
Dan @ Austria yazmış:
Hi,
i m a developer with some experience in python and django - a
framework i realy like. However, i just read the sqlalchemy docu and i
think the orm seems to be really professional.
Is sqlalchemy the most prominent orm for python? Is it suitable to
write larger
I'm using sqlalchemy with turbogears framework.
I have some tables and some complex queries with lots of joins and
filters. is tehere a simple way to make those queries like views and use
those views in other more complex queries like they are tables?
--
You received this message because you
On Jun 29, 2010, at 11:07 AM, Chris Withers wrote:
Michael Bayer wrote:
Specifically, the following:
- change the primary key of the instance by deleting it so that the
dataabse assigns a new primary key?
that wont work. you need to take the object and call make_transient() on
it,
Short version: How do I completely dispose of all resources belonging
to an engine that uses a standard queue pool?
I have a Web service that creates a bunch of engines on demand (that
all use the default QueuePool). It needs to close inactive connections
after X seconds. I monitor access to
On Jun 29, 12:21 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Jun 29, 2010, at 1:47 PM, Wyatt Lee Baldwin wrote:
Short version: How do I completely dispose of all resources belonging
to an engine that uses a standard queue pool?
I'll reference the docs below just so they're here, I
Michael Bayer wrote:
for thing in session.query(MyThing).all():
... print x.id, x.name, x.value, x.valid_from, x.valid_to
1, 'foo', 100, 2010-06-29 09:00, 2010-06-29 09:05
2, 'foo', 200, 2010-06-29 09:05, None
`x` used to correspond to the row with id of 1, but now corresponds to the row
On Jun 29, 2010, at 5:41 PM, Wyatt Lee Baldwin wrote:
It's a fairly standard multi-threaded Pylons Web app that calls
Session.remove() at the end of each request. All DB operations go
through the ORM.
Disregarding all the verbiage below, it sounds like Session.remove
already does what I
On Jun 29, 2010, at 6:27 PM, Chris Withers wrote:
Michael Bayer wrote:
for thing in session.query(MyThing).all():
... print x.id, x.name, x.value, x.valid_from, x.valid_to
1, 'foo', 100, 2010-06-29 09:00, 2010-06-29 09:05
2, 'foo', 200, 2010-06-29 09:05, None
`x` used to correspond to
Michael Bayer wrote:
- I take it there are no problems with specifying multiple extensions to
sessionmaker? (we need zope.sqlalchemy's extension too) What effect does order
of extensions have?
calls them in order
heh, so what order to put 'em in? I'm guessing zope.sqlalchemy's one
should
21 matches
Mail list logo