[sqlalchemy] Re: Any libraries or examples of how to let users define custom fields on SA tables/objects

2010-04-21 Thread Ants Aasma
On Apr 18, 10:43 pm, Randy Syring ra...@rcs-comp.com wrote: So, this seems like a relatively common paradigm and I was hoping someone might already know of a library or example application for using SA to accomplish this.  I am looking for something akin to Rail's acts_as_cutomizable plugin

[sqlalchemy] startswith operator Oracle

2010-04-21 Thread Grimsqueaker
It looks as though SQLAlchemy doesn't use the startswith() operator properly in Oracle (using SA 0.6). col1.startswth(col2) gives me col1 LIKE col2 + '%%' which should be col1 LIKE col2 || '%%' . Am I doing something wrong or should this be reported? Thanks -- You received this message

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-21 Thread Michael Bayer
Rhett Garber wrote: This would be much easier, I could potentially be what we go with. I think this is similar to my 'original implementation' I just found the syntax to be a bit bothersome since the person creating the table has to know they are creating two columns... or not using

Re: [sqlalchemy] startswith operator Oracle

2010-04-21 Thread Michael Bayer
Grimsqueaker wrote: It looks as though SQLAlchemy doesn't use the startswith() operator properly in Oracle (using SA 0.6). col1.startswth(col2) gives me col1 LIKE col2 + '%%' which should be col1 LIKE col2 || '%%' . Am I doing something wrong or should this be reported? that looks

[sqlalchemy] sql clauses as bound parameters

2010-04-21 Thread Paul Balomiri
Hi, Is it possible to supply bindparam a clause type? I want to execute a query of the form select * from f(:a, :b,:c) where :b might be either a String or a function. if :b is a function, i'd like to do something like: s=select([col1 , col2, col3], from_obj=func.f(bindparam('a'),

[sqlalchemy] Re: sql clauses as bound parameters

2010-04-21 Thread Paul Balomiri
Alternatively a possibility to replace a bindparam Expression with some other Expression would do it too... 2010/4/21 Paul Balomiri paulbalom...@gmail.com: Hi, Is it possible to supply bindparam a clause type? I want to execute a query of the form select * from f(:a, :b,:c) where :b might

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-21 Thread Rhett Garber
On Wed, Apr 21, 2010 at 6:35 AM, Michael Bayer mike...@zzzcomputing.com wrote: Rhett Garber wrote: This would be much easier, I could potentially be what we go with. I think this is similar to my 'original implementation' I just found the syntax to be a bit bothersome since the person

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-21 Thread Michael Bayer
On Apr 21, 2010, at 4:08 PM, Rhett Garber wrote: On Wed, Apr 21, 2010 at 6:35 AM, Michael Bayer mike...@zzzcomputing.com wrote: Rhett Garber wrote: This would be much easier, I could potentially be what we go with. I think this is similar to my 'original implementation' I just found the

Re: [sqlalchemy] Custom ORM attributes to provide on-the-fly data conversion

2010-04-21 Thread Michael Bayer
Rhett Garber wrote: Oh right, sorry: class Advertiser(Base):    __tablename__ = advertiser    id, _id = build_id_column('id', primary_key=True)    salesperson_id, _salesperson_id = build_id_column('salesperson_id', foreign_key=ForeignKey(%s.id % Salesperson.__tablename__))