On Tuesday, 10 December 2013 01:00:51 UTC-5, Michael Bayer wrote:
that’s a little strange but you can get around it using CAST:
match = session.query(MyTable).\
filter(MyTable.myset == cast(z, ARRAY(String))).\
all()
Unfortunately, that doesn't work.
On Tuesday, 10 December 2013 03:29:48 UTC-5, Matthew Pounsett wrote:
On Tuesday, 10 December 2013 01:00:51 UTC-5, Michael Bayer wrote:
that’s a little strange but you can get around it using CAST:
match = session.query(MyTable).\
filter(MyTable.myset == cast(z, ARRAY(String
On Tuesday, 10 December 2013 10:00:20 UTC-5, Michael Bayer wrote:
the test case I’m using is below. You might want to make sure you’re on
the latest psycopg2, this is also SQLAlchemy 0.8.4 but the SQL output seems
the same. Overall, if maybe you’re on an older postgresql version, you
I'm trying to work with the postgres ARRAY type and I'm having a hard time
figuring out what I'm doing wrong with filtering queries on the array
column. Here's some sample code, omitting the session setup:
class MyTable(Base):
On Thursday, 25 July 2013 11:39:23 UTC-4, Michael Bayer wrote:
But your backend isn't doing this; if you were using Postgresql for
example, it should be returning a timedelta() already. So perhaps this is
MySQL. you'd need to make a TypeDecorator that receives this integer and
does
On Monday, 29 July 2013 20:48:57 UTC-4, Matthew Pounsett wrote:
I think I understand the mechanism here... except that since this isn't a
real type (there's no data store behind this) is process_bind_param()
useful at all?
To answer my own question... yes, of course it does because
I have a class with 'start' and 'finish' attributes which are DateTime
columns. I'm trying to create a hybrid property 'duration' which returns
the delta as a datetime.timedelta object. This is working fine for the
instance attribute, but I can't seem to get it to work for the class
Does the ORM allow for filtering by a variable attribute name? I found
this discussion using raw SQL:
https://groups.google.com/d/topic/sqlalchemy/Axa-0thwOR8/discussion
But the suggestion doesn't seem to apply in my case. Some sample code to
demonstrate what I'm trying based on the above
On Tuesday, 23 July 2013 04:16:24 UTC-4, Simon King wrote:
You can use the standard python getattr function for this:
Ah, of course. That should have occurred to me to try. Thanks, works like
a charm!
--
You received this message because you are subscribed to the Google Groups
On Monday, 12 March 2012 01:35:10 UTC-4, Michael Bayer wrote:
both the left and right sides of an expression are ultimately represented
as SQLAlchemy ColumnElements. When you say somecol == 'somestr', the
'somestr' part is coerced into a literal object as a result of it being
pulled into
I'm having a tough time figuring out how to manage this, and I don't
think I know enough about what the end result might look like to be
able to google it successfully.
I'm trying to invert the sense of the like() operation in an unusual
way. Rather than doing 'not like()' I want to take the
11 matches
Mail list logo