Re: [sqlalchemy] Autocreate parent while inserting child

2011-06-22 Thread Fayaz Yusuf Khan
On Monday, June 20, 2011 07:34:42 PM Michael Bayer wrote: SQLA doesn't automatically create any objects so you'd need to create the Parent object yourself, but you'd also use relationship(): class Child(Base): parent_name = Column(String, ForeignKey('parent.name')) parent =

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-22 Thread Anton
On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added StatementError after having too often a custom type or other kind of error happen deep inside the preparation

[sqlalchemy] Re: A question about the Hybrid Value pattern for encrypted values

2011-06-22 Thread Roy Hyunjin Han
In my case, I want to enforce case-insensitive comparison for encrypted email addresses. The hybrid can be made to work for encryption very nicely if you use a comparator that coerces the value to its encrypted form before passing to the database.   It's worth publishing so I created an

Re: [sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-22 Thread Michael Bayer
On Jun 22, 2011, at 3:41 AM, Anton wrote: On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added StatementError after having too often a custom type or other kind of

Re: [sqlalchemy] Autocreate parent while inserting child

2011-06-22 Thread Michael Bayer
On Jun 22, 2011, at 2:53 AM, Fayaz Yusuf Khan wrote: On Monday, June 20, 2011 07:34:42 PM Michael Bayer wrote: SQLA doesn't automatically create any objects so you'd need to create the Parent object yourself, but you'd also use relationship(): class Child(Base): parent_name =

[sqlalchemy] Re: Raising exceptions from TypeDecorator.process_bind_param()

2011-06-22 Thread Anton
On 22 июн, 17:48, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 22, 2011, at 3:41 AM, Anton wrote: On 22 июн, 01:31, Michael Bayer mike...@zzzcomputing.com wrote: On Jun 21, 2011, at 7:04 PM, Anton wrote: On 22 июн, 00:47, Michael Bayer mike...@zzzcomputing.com wrote: I added

[sqlalchemy] sqlalchemy.exc.ProgrammingError

2011-06-22 Thread Bogdan Tenea
It looks like it's not actualy replacing values when using a Query object and it's methods. Getting this for first() and get() experts_mapper = mapper(Expert, experts) currencies_mapper = mapper(Currency, currencies) inputs_mapper = mapper(Input, inputs, properties={'expert' : relation(Expert,

Re: [sqlalchemy] sqlalchemy.exc.ProgrammingError

2011-06-22 Thread Michael Bayer
No, those are bound parameter values. What MySQL dialect are you using ? We currently have limited support for Python 3 + MySQL - only OurSQL works at all and its currently failing tests. The fact that the statement is sent as a bytestring is also suspect here. On Jun 22, 2011, at

Re: [sqlalchemy] intersect_all vs chaining of filter

2011-06-22 Thread Mike Conley
On Tue, Jun 21, 2011 at 6:05 AM, Eduardo ruche...@googlemail.com wrote: What is the best practice: to chain filters or to collect queries in a list and then apply intersect_all()? Overall efficiency will depend on the underlying database engine, but I can't help but expect that most databases