[sqlalchemy] Re: inner join and ambiguous columns

2010-03-22 Thread marco vaccari
Sorry. I speak english in rare occasions. No. It is not an insert into a join. The result of a join between tables A and B is the VALUES partial set for an insert into table C. sql = A.join(B).select(A.c.id == an_id, fold_equivalents=True, use_labels=False) rec = sql.execute().fetchone()

[sqlalchemy] Re: 0.6 and c extensions

2010-03-22 Thread drakkan
On 21 Mar, 21:11, Gaetan de Menten gdemen...@gmail.com wrote: On Sun, Mar 21, 2010 at 17:13, drakkan drakkan1...@gmail.com wrote: On 21 Mar, 14:31, Antoine Pitrou solip...@pitrou.net wrote: Le dimanche 21 mars 2010 à 02:10 -0700, drakkan a écrit : a really interesting feature in sa 0.6

RE: [sqlalchemy] recommended declarative method design pattern for sessions

2010-03-22 Thread King Simon-NFHD78
Daniel Robbins wrote: Hi All, One of the things that doesn't seem to be covered in the docs, and that I'm currently trying to figure out, is the recommended design pattern to use for managing sessions from declarative methods calls. Consider a declarative class User, where I want to

Re: [sqlalchemy] Re: inner join and ambiguous columns

2010-03-22 Thread Michael Bayer
On Mar 22, 2010, at 4:09 AM, marco vaccari wrote: Sorry. I speak english in rare occasions. No. It is not an insert into a join. The result of a join between tables A and B is the VALUES partial set for an insert into table C. sql = A.join(B).select(A.c.id == an_id,

[sqlalchemy] Session user data

2010-03-22 Thread Kent
I have a need to pass around session-dependent application data, such as strong references to certain objects that I don't want garbage collected so they will serve as a cache for the duration of the session. For example, if the application performs a get() on a SystemParameters table, I want a

Re: [sqlalchemy] Session user data

2010-03-22 Thread Michael Bayer
On Mar 22, 2010, at 9:06 AM, Kent wrote: I have a need to pass around session-dependent application data, such as strong references to certain objects that I don't want garbage collected so they will serve as a cache for the duration of the session. For example, if the application performs

[sqlalchemy] @compiles: only apply in select clause, but not in where clause

2010-03-22 Thread Tobias
Hi, I am working on the extension GeoAlchemy [1]. Currently GeoAlchemy always fetches the data for the mapped geometry attributes in the database internal format. I am trying to force GeoAlchemy to use the format WKB for the communication with the database. @compiles(MyColumn) def

Re: [sqlalchemy] @compiles: only apply in select clause, but not in where clause

2010-03-22 Thread Michael Bayer
On Mar 22, 2010, at 12:31 PM, Tobias wrote: Hi, I am working on the extension GeoAlchemy [1]. Currently GeoAlchemy always fetches the data for the mapped geometry attributes in the database internal format. I am trying to force GeoAlchemy to use the format WKB for the communication with

Re: [sqlalchemy] callproc support

2010-03-22 Thread Kevin Wormington
That's getting closer. Now if I could just figure out how to get it to use the parameters that I'm actually passing in engine.execute. It appears ibm_db_sa botches the sql (to CALL BILLING.subscriber_balance()) if use the commented out cursor.callproc(statement, parameters). from

Re: [sqlalchemy] callproc support

2010-03-22 Thread Michael Bayer
On Mar 22, 2010, at 3:48 PM, Kevin Wormington wrote: That's getting closer. Now if I could just figure out how to get it to use the parameters that I'm actually passing in engine.execute. It appears ibm_db_sa botches the sql (to CALL BILLING.subscriber_balance()) if use the commented

Re: [sqlalchemy] callproc support

2010-03-22 Thread Kevin Wormington
Michael Bayer wrote: On Mar 22, 2010, at 3:48 PM, Kevin Wormington wrote: That's getting closer. Now if I could just figure out how to get it to use the parameters that I'm actually passing in engine.execute. It appears ibm_db_sa botches the sql (to CALL BILLING.subscriber_balance()) if

Re: [sqlalchemy] Session user data

2010-03-22 Thread Chris Withers
Michael Bayer wrote: subclass Query and setup caching options. There's examples in the 0.6 distro that use Beaker including one that assigns the cache to be local to the Session, but attached is a simpler version from my pycon tutorial that doesn't have any dependencies. !DOCTYPE html

Re: [sqlalchemy] recommended declarative method design pattern for sessions

2010-03-22 Thread Daniel Robbins
On Mar 22, 2010, at 5:10 AM, King Simon-NFHD78 wrote: See the 'How can I get the Session for a certain object' question at http://www.sqlalchemy.org/docs/session.html#frequently-asked-questions Basically, in your FindFriends method, replace: session = Session() with: session =

[sqlalchemy] Single class to use multiple identical tables

2010-03-22 Thread Cameron Higby-Naquin
Hi, I have a somewhat unusual database schema and was wondering what would be the best way for SQLAlchemy to handle it. For simplification purposes let's call our two basic objects Widgets and Dashboards. The widgets are divided up across 100 tables which all have identical columns, including

Re: [sqlalchemy] Session user data

2010-03-22 Thread Michael Bayer
did I attach an HTML file ? heres a link : http://bitbucket.org/zzzeek/pycon2010/src/tip/chap5/query_subclass.py On Mar 22, 2010, at 4:14 PM, Chris Withers wrote: Michael Bayer wrote: subclass Query and setup caching options. There's examples in the 0.6 distro that use Beaker

Re: [sqlalchemy] callproc support

2010-03-22 Thread Michael Bayer
On Mar 22, 2010, at 4:06 PM, Kevin Wormington wrote: Michael Bayer wrote: On Mar 22, 2010, at 3:48 PM, Kevin Wormington wrote: That's getting closer. Now if I could just figure out how to get it to use the parameters that I'm actually passing in engine.execute. It appears ibm_db_sa