[sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Martijn
When installing on OSX the install log shows: building 'sqlalchemy.cprocessors' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe

Re: [sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Tony Theodore
On 24 June 2011 18:50, Martijn mart...@xs4us.nu wrote: When installing on OSX the install log shows: building 'sqlalchemy.cprocessors' extension gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch

Re: [sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Martijn
Thanks, but changing is not a real option for now since lots of modules are compiled against this version I never had this problem with other versions of sqla though It is about time PPC supported by default should be dropped.. On Jun 24, 2011, at 12:30 , Tony Theodore wrote: On 24 June

Re: [sqlalchemy] [0.7.1] Building C extentions fail on installing for OS X

2011-06-24 Thread Michael Bayer
This is a distutils issue, those flags are part of your Python install. There's ways to affect what they come out as with environment variables, but in my experience installing the OSX build from the Python site (or building a new Python from scrtch) is usually the only way to really get

[sqlalchemy] per-host pooling vs per-engine pooling

2011-06-24 Thread Tarek Ziadé
Hello I was wondering if there's a simple way to do per-host pooling. Here's my use case: I have several hosts and on each one of them has several databases hosted in mysql. the engine is tied to a specific database when you create it, so the default pool will pool connection on a specific

[sqlalchemy] Error using Versioned objects and Association Proxy together

2011-06-24 Thread 371c
Hi all, I have a problem when using the versioned recipe together with Association proxy. Some code may make this clear: import... class ItemKeywordAsso(Base): __tablename__ = item_keywords id = Column(Integer, primary_key=True) item_id = Column(Integer,

[sqlalchemy] query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
Hi, I am trying to write a proper query_chooser method for our user based sharding. To do so, I need to be able to query the value of the query's criterions. I have the following model: class User(object): id = Column(Integer, primary_key=True) ... class Subscription(object): id =

Re: [sqlalchemy] per-host pooling vs per-engine pooling

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 11:01 AM, Tarek Ziadé wrote: Hello I was wondering if there's a simple way to do per-host pooling. Here's my use case: I have several hosts and on each one of them has several databases hosted in mysql. the engine is tied to a specific database when you create it,

Re: [sqlalchemy] query_chooser and relationship queries

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 12:49 PM, Arthur Kopatsy wrote: Hi, I am trying to write a proper query_chooser method for our user based sharding. To do so, I need to be able to query the value of the query's criterions. I have the following model: class User(object): id = Column(Integer,

Re: [sqlalchemy] Error using Versioned objects and Association Proxy together

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 12:03 PM, 371c wrote: Hi all, I have a problem when using the versioned recipe together with Association proxy. Some code may make this clear: import... class ItemKeywordAsso(Base): __tablename__ = item_keywords id = Column(Integer,

[sqlalchemy] Re: query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
Awesome. Does that mean the sqlalchemy example is wrong. It currently has: if callable(value): value = value() Should it be something like that? if value == None and bind.callable != None: |verificationTokenExpiry = Column(String) value =

Re: [sqlalchemy] Re: query_chooser and relationship queries

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 1:26 PM, Arthur Kopatsy wrote: Awesome. Does that mean the sqlalchemy example is wrong. It currently has: if callable(value): value = value() yeah thats out of date, usage was changed in 0.7. Should it be something like that? if value

[sqlalchemy] Re: query_chooser and relationship queries

2011-06-24 Thread Arthur Kopatsy
Great. Of course that line ( |    verificationTokenExpiry = Column(String)) was a copy and paste mistake. On Jun 24, 10:28 am, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 24, 2011, at 1:26 PM, Arthur Kopatsy wrote: Awesome. Does that mean the sqlalchemy example is wrong. It

[sqlalchemy] Re: cascade_backrefs=False broken for many-to-many relationships?

2011-06-24 Thread Robert Rollins
Ahhh, ok! I was missing two important bits of info: 1) I didn't know about the backref() function. I was just using backref='users' in my relationship() args. 2) Thus, I didn't realize that using cascade_backrefs=False as an arg to relationship() would apply the setting in the wrong direction.

Re: [sqlalchemy] per-host pooling vs per-engine pooling

2011-06-24 Thread Tarek Ziadé
On Fri, Jun 24, 2011 at 7:04 PM, Michael Bayer mike...@zzzcomputing.com wrote: ... Is there a way to do it with the existing pools ?   If not, I guess I'll work on a custom Pool, well a pool is geared towards one specific connection which already has a database set up on it.    I guess maybe

Re: [sqlalchemy] call mysql procedure (as opposed to function) using sql expression language

2011-06-24 Thread Chris Withers
On 15/06/2011 19:13, Michael Bayer wrote: session.execute('call myfunc()').scalar() ...but is there a way I can generate that? i havent worked with MySQL sps but maybe there's a way to CREATE FUNCTION instead of SP, not sure, otherwise you'd probably want to do this: class

Re: [sqlalchemy] per-host pooling vs per-engine pooling

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 2:51 PM, Tarek Ziadé wrote: On Fri, Jun 24, 2011 at 7:04 PM, Michael Bayer mike...@zzzcomputing.com wrote: ... Is there a way to do it with the existing pools ? If not, I guess I'll work on a custom Pool, well a pool is geared towards one specific connection which

Re: [sqlalchemy] call mysql procedure (as opposed to function) using sql expression language

2011-06-24 Thread Michael Bayer
On Jun 24, 2011, at 3:22 PM, Chris Withers wrote: On 15/06/2011 19:13, Michael Bayer wrote: session.execute('call myfunc()').scalar() ...but is there a way I can generate that? i havent worked with MySQL sps but maybe there's a way to CREATE FUNCTION instead of SP, not sure, otherwise