Michael Bayer wrote:
we have the in_() construct. It should be in the ORM and SQL expression
tutorials:
t1 = Table('mytable', metadata, Column('foo', String))
select([t1]).where(t1.c.foo.in_(['a', 'b', 'c']))
However, that requires table/column objects which I don't have.
Are the innards
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers
Sent: 28 April 2010 14:37
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] session lifecycle and wsgi
Hi All,
I'm still trying to get an answer on this...
HI
I have been using the oracle database for my appliaction.
i set the environment variables as
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/
server
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=XE
I started the
Hi Chris:
I'm a bit hesitant to share what I've done, b/c it's still a work in
progress etc, but here goes:
MySQL MyISAM, wait_timeout=28800
SQLAlchemy 0.5.6, pool_recycle=3600
I've written a few decorators (mostly stolen from SQLAlchemy docs
examples):
def with_query_write(fn):
Diana Clarke wrote:
I'm a bit hesitant to share what I've done, b/c it's still a work in
progress etc, but here goes:
MySQL MyISAM, wait_timeout=28800
You have no transactions, so I'm not sure why you're worrying about
them... Switch to InnoDB if you want transactions...
Finally,
On Wed, Apr 28, 2010 at 7:52 AM, Chris Withers ch...@simplistix.co.uk wrote:
Diana Clarke wrote:
Finally, we're using pylons and are removing the contextual session in the
finally clause of the base controller's __call__ method.
class BaseController(WSGIController):
def __call__(self,
Yup, no transactions (legacy, can't switch anytime soon) which is why
I didn't originally write any rollback framing... but I was still
getting the following error after MySQL raised a 2006 (until app
restart), and a quick peek at _handle_dbapi_exception seemed to
suggest that I needed to issue
Chris,
This is what the combination of repoze.tm2/transaction and
zope.sqlalchemy does for you. You don't have to do anything special
other than that.
Laurence
On Apr 28, 2:37 pm, Chris Withers ch...@simplistix.co.uk wrote:
Hi All,
I'm still trying to get an answer on this...
Am I right in
Laurence Rowe wrote:
Chris,
This is what the combination of repoze.tm2/transaction and
zope.sqlalchemy does for you. You don't have to do anything special
other than that.
It doesn't do the .remove().
BFG currently has a bit of horribleness to make that work.
I'd like to get rid of it or make
jason kirtland wrote:
On Wed, Apr 28, 2010 at 7:52 AM, Chris Withers ch...@simplistix.co.uk wrote:
Diana Clarke wrote:
Finally, we're using pylons and are removing the contextual session in the
finally clause of the base controller's __call__ method.
class BaseController(WSGIController):
Hi All,
Let's say that when a database record is added or updated, I need to
perform some arbitrary action (in my case, ensuring that data in other
tables is consistent with what is being committed.)
What mechanisms are suggested for this? I could add a save() method to
my declarative class that
Daniel Robbins wrote:
Let's say that when a database record is added or updated, I need to
perform some arbitrary action (in my case, ensuring that data in other
tables is consistent with what is being committed.)
What mechanisms are suggested for this?
Mapper extesions:
On Wed, Apr 28, 2010 at 10:04 AM, Chris Withers ch...@simplistix.co.uk wrote:
Daniel Robbins wrote:
Let's say that when a database record is added or updated, I need to
perform some arbitrary action (in my case, ensuring that data in other
tables is consistent with what is being committed.)
On Wed, Apr 28, 2010 at 8:55 AM, Chris Withers ch...@simplistix.co.uk wrote:
jason kirtland wrote:
On Wed, Apr 28, 2010 at 7:52 AM, Chris Withers ch...@simplistix.co.uk
wrote:
Diana Clarke wrote:
Finally, we're using pylons and are removing the contextual session in
the
finally clause of
Daniel Robbins wrote:
On Wed, Apr 28, 2010 at 10:04 AM, Chris Withers
ch...@simplistix.co.uk wrote:
Daniel Robbins wrote:
Let's say that when a database record is added or updated,
I need to
perform some arbitrary action (in my case, ensuring that
data in other
tables is
On Wed, Apr 28, 2010 at 10:25 AM, King Simon-NFHD78
simon.k...@motorola.com wrote:
The declarative docs include an example of using a MapperExtension:
http://www.sqlalchemy.org/docs/reference/ext/declarative.html#mapper-con
figuration
Great, thanks for everyone's help. This is exactly the
I have code which generates mapped classes, some of which are actually
already existing
in the database ( I the sense that there is a corresponding row ).
Example: given the declarative class
class Frob(Base):
__tablename__ = frobs
id = Column(Integer, primary_key = True )
name =
jason kirtland wrote:
On Wed, Apr 28, 2010 at 7:52 AM, Chris Withers ch...@simplistix.co.uk
wrote:
Diana Clarke wrote:
Finally, we're using pylons and are removing the contextual session in
the
finally clause of the base controller's __call__ method.
class BaseController(WSGIController):
Diana Clarke wrote:
Yup, no transactions (legacy, can't switch anytime soon) which is why
I didn't originally write any rollback framing... but I was still
getting the following error after MySQL raised a 2006 (until app
restart), and a quick peek at _handle_dbapi_exception seemed to
suggest
Michael Bayer wrote:
If finishing with a .remove() is a big deal in your environment, which
it seems like it is, you could do a .remove() at the start of the
request instead.
You really don't need the remove() if you have definitely called
commit() or rollback() last, and you have
Chris Withers wrote:
Michael Bayer wrote:
If finishing with a .remove() is a big deal in your environment, which
it seems like it is, you could do a .remove() at the start of the
request instead.
You really don't need the remove() if you have definitely called
commit() or rollback() last,
Hi all,
I faced a problem comparing Selects. It seems that Select.compare()
works incorrectly.
Here is the code that shows the problem:
from sqlalchemy import MetaData
from sqlalchemy import Table, Column
from sqlalchemy import Integer, String
from sqlalchemy import select
metadata =
dimazest wrote:
Hi all,
I faced a problem comparing Selects. It seems that Select.compare()
works incorrectly.
Here is the code that shows the problem:
from sqlalchemy import MetaData
from sqlalchemy import Table, Column
from sqlalchemy import Integer, String
from sqlalchemy import
Hi guys,
I have the following Table construction:
ADMIN_TABLE = Table('admin',
bound_meta_data,
Column('username', types.VARCHAR(100),
primary_key=True),
autoload=True, schema=schema)
and a mapper as such:
24 matches
Mail list logo