[sqlalchemy] Re: Using sqlalchemy in twisted.

2009-03-11 Thread Jeff FW
Logging SA objects *after* the session is gone will always be a problem, unless you make sure to detach all of them from the session. I'd just log the original request, instead. In my case, I have to convert all of my SA objects to something Perspective Broker understands, so I actually log

[sqlalchemy] Re: Using sqlalchemy in twisted.

2009-03-11 Thread 一首诗
Hi Jeff, In my project I use the *model* to indicate an instance of Database. I don't really need multiple instances of Database. But when I wrote unit test, I always create an new one database in setup, which create a new sqlite in memory database to avoid conflicts between test cases. About

[sqlalchemy] Re: Supporting fully-qualified table names and cross-database references in Sybase and SQL Server?

2009-03-11 Thread phrrn...@googlemail.com
I wasn't able to get it working so easily using the existing entry- points so I created a new one, quote_schema, and use it explicitly in a couple of places in compiler.py. The default implementation is the same as the old one. pjjH +def quote_schema(self, schema, force): +Quote a

[sqlalchemy] How to set default join onclause if table has more than one FK to another table?

2009-03-11 Thread sector119
Hi All! How to set default join condition if table has more than one FK to another table? It may be Transaction.user_id==User.id or Transaction.rollback_user_id==User.id, I want first one to be default, is it possible to do? transactions_table = sa.Table('transactions', meta.metadata,

[sqlalchemy] How to map columns into a tuple using SQLAlchemy?

2009-03-11 Thread batraone
Hi, I'm just starting to use SQLAlchemy and hit a roadblock. I have a class Result which contains a tuple called _limits. _limits = (Upper value, lower value, nominal) I would like to map a the table's columns directly into this tuple. From the documentation, all I can see is columns

[sqlalchemy] How to map columns into a tuple using SQLAlchemy?

2009-03-11 Thread batraone
Hi, I'm just starting to use SQLAlchemy and hit a roadblock. I have a class Result which contains a tuple called _limits. _limits = (Upper value, lower value, nominal) I would like to map a the table's columns directly into this tuple. From the documentation, all I can see is columns

[sqlalchemy] Help! More Class-Mapper confusion!

2009-03-11 Thread batraone
Hi, OK - I ran into another thing that I do not understand about sqlalchemy. I am a newbie, so hopefully this will be straightforward. There are two issues here: ISSUE1: I create a class called foo w/ a method called name(). I map a table that has a column called 'name' but use the

[sqlalchemy] Re: Help! More Class-Mapper confusion!

2009-03-11 Thread Michael Bayer
batraone wrote: def map(self, myfoo): 'Creates the map. ' orm.mapper(Foo, self.t_foo, column_prefix = '_') # Add foo to the database print dir(myfoo) # where did _name go?, _phone is there! mf2 = Foo() # ok, let's create a new one.

[sqlalchemy] Re: Help! More Class-Mapper confusion!

2009-03-11 Thread batraone
Thanks. I don't have control over the instance creation. These pre- created objects are handed down to me. I could create an adapter that maps the original class to the one that has been mapped but this is quite a bit of work as I have to manually copy over each of the source class attributes to

[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-11 Thread Scott
When I do this... cpt_codes = ManyToMany( ... order_by = procedure_cpt_codes.c.cpt_codes_idx ) # procedure_cpt_codes is the JOIN table in between the parent (procedure) --- children (cpt_codes) # procedure_cpt_codes has 3 columns...procedure_id (foreign key), cpt_code_id (foreign key) and

[sqlalchemy] SQLAlchemy based syndication feed framework?

2009-03-11 Thread Noah Gift
Does anyone on this list know of a simple WSGI compatible, SQLAlchemy based feed framework, like the one offered with Django: http://docs.djangoproject.com/en/dev/ref/contrib/syndication/?from=olddocs -- Cheers, Noah --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: SQLAlchemy based syndication feed framework?

2009-03-11 Thread Noah Gift
On Thu, Mar 12, 2009 at 11:25 AM, Noah Gift noah.g...@gmail.com wrote: Does anyone on this list know of a simple WSGI compatible, SQLAlchemy based feed framework, like the one offered with Django: http://docs.djangoproject.com/en/dev/ref/contrib/syndication/?from=olddocs To answer my own

[sqlalchemy] Re: SQLAlchemy based syndication feed framework?

2009-03-11 Thread Walter Cruz
webhelpers, from Pylons, has a handy rss generator. I use it with SQLAlchemy, works fine. On Wed, Mar 11, 2009 at 8:00 PM, Noah Gift noah.g...@gmail.com wrote: On Thu, Mar 12, 2009 at 11:25 AM, Noah Gift noah.g...@gmail.com wrote: Does anyone on this list know of a simple WSGI compatible,

[sqlalchemy] Re: SQLAlchemy based syndication feed framework?

2009-03-11 Thread Noah Gift
-- Forwarded message -- From: Walter Cruz walter@gmail.com Date: Thu, Mar 12, 2009 at 12:19 PM Subject: [sqlalchemy] Re: SQLAlchemy based syndication feed framework? To: sqlalchemy@googlegroups.com webhelpers, from Pylons, has a handy rss generator. I use it with SQLAlchemy,

[sqlalchemy] Re: Help! More Class-Mapper confusion!

2009-03-11 Thread Michael Bayer
On Mar 11, 2009, at 6:05 PM, batraone wrote: Thanks. I don't have control over the instance creation. These pre- created objects are handed down to me. I could create an adapter that maps the original class to the one that has been mapped but this is quite a bit of work as I have to

[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-11 Thread Michael Bayer
On Mar 11, 2009, at 6:17 PM, Scott wrote: When I do this... cpt_codes = ManyToMany( ... order_by = procedure_cpt_codes.c.cpt_codes_idx ) # procedure_cpt_codes is the JOIN table in between the parent (procedure) --- children (cpt_codes) # procedure_cpt_codes has 3

[sqlalchemy] Late and ugly error when mixing timezone-savvy and timezone-naive datetimes

2009-03-11 Thread Gunnlaugur Briem
Hi, I get away with stuffing datetime.datetime.now() into a DateTime (timezone=True) column, despite the former being timezone-naive (.utcoffset() is None, .tzinfo is None, etc.). It is stored in the table with UTC offset +00, which is arguably incorrect (states information that was not present