Thanks!
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
I had a similar needs with generating diffs for tracking revision history a
while back
I ended up pushing everything into a mixin class. It worked a little like
this...
class MutatedChecknObject(object):
def generate_diff(self):
insp = sqlalchemy_inspect(self)
Thanks for the history lesson!
A large part of me things that both strings or objects should be accepted
, this way there would be parity across the board. Because yes, it is
confusing!
But a larger part of me worries about backwards compatibility and
collisions. ForeignKey(mytable.id)
this has just confused me for a while , and constantly trips me up...
class FirstTable()
__tablename__ = 'first_table'
id = Column(Integer, primary_key=True)
class SecondTable()
__tablename__ = 'second_table'
id = Column(sa.Integer, primary_key=True)
I don't , but should. I've just used database dumps and a homebrew system,
because tools like this didn't exist when I first needed them.
BUT it seems to offer the same functionality as Rails/Django migrations ,
which you will eventually need in your new Django-favoring environment.
--
You
I saw this a while back:
https://pypi.python.org/pypi/mixer/1.1.6
which claims to handle both Django SqlAlchemy, so it might be more
familiar to them.
there are a few fixtures projects for Sqlalchemy on PyPi
I *think* you might be able to get away with some stuff using Alembic, but
FYI , you can also drop SqlAlchemy core/engine commands within the
`connection.execute()` and reference the ORM
connection.execute(
model.core.Client.__table__\
.update()\
.where( model.core.Client.id == id )\
.values( lastupdate = NOW() )
)
it's a little
I just got this error on a query:
DataError: (DataError) integer out of range
( along with the query )
Is there any way to get the details of which column failed ?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
This might be moot - PostgreSQL doesn't seem to show which column failed in
their command-line tool.
[sidenote: I did know what the problem was - an INT column where BIGINT was
appropriate - the error reporting just seemed too generic ]
--
You received this message because you are subscribed
It won't answer your question, but you should read the 2 links mike pointed
me to over here:
https://groups.google.com/d/msg/sqlalchemy/ZsHxDzlATCQ/sQvnAORluMsJ
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and
I'm not sure if this is possible. I was hoping it was, but my attempts so
far didn't work. I've got a separate select going, but would love to pare
things down to one.
I'm wanting to map a relationship where two columns match ( not one ) and
there is a boolean filter
Class Author:
id =
primaryjoin = and_(Article.author_id == AuthorOverride.author_id ,
Article.topic_id == AuthorOverride.topic_id ,
AuthorOverride.is_published == True)
,
foreign_keys = ( Article.author_id , Article.topic_id),
Solved . I was close.
1. Wrap the join conditions in
From my understanding, this should be safe with Twisted:
- SqlAlchemy engine operations, where you don't use the ORM and
encapsulate every ansync chunk in a transaction, and within a thread
- SqlAlchemy orm operations, where every async chunk is encapsulated in
it's own session, and within a
On Monday, October 7, 2013 8:27:34 PM UTC-4, Klauss wrote:
3- open a single request-scope session, and carry it through your async
tasks.
I left that out, because it brings up the problem where your long-running
session blocks the database (via transactions) or if you're in some
That query looks weird.
I'd suggest converting everything to a date in the database and having the
db sort it --
on postgres it would look like this --
create table test_date ( id serial primary key not null , int , mm int
, dd int );
select *
from
test_date
where
(
So the No SqlAlchemy with Twisted approach is dated.
I've been on the twisted list for a while, and recently asked it -- as i
have a bit of stuff for the same project running in twisted as-well-as
pyramid and-also celery.
The current consensus is that it's a general no-go/bad-idea if you're
Also, a decent strategy to use is this:
a) Your client does a lot of business logic in Pyramid. When you need to
bill you hit an internal API or create a celery task
b) You render a waiting page, and have ajax, or refresh, check to see if
the internal API , or celery, is done processing
c)
do you recall if `flush()` initiated 'mark_changed' at some point in
history? i thought it did.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I think the issue might be related to this:
https://github.com/zopefoundation/zope.sqlalchemy/blob/master/src/zope/sqlalchemy/datamanager.py#L213
Record that a flush has occurred on a session's connection. This allows
the DataManager to rollback rather than commit on read only transactions.
Any progress on considering:
* icontains
* istartswith
* iendswith
I ran into this again ( i had posted a similar request about a year or so
ago )
re But then what do we do on a backend that doesn't have ilike? do we
raise an error?
would this be possible:
.filter(
funny- I never noticed the time column in pyramid_debugtoolbar -- I use it
all the time !
i ended up doing a lot of my profiling outside of pyramid though. that's
something i really love about sqlalchemy (and pyramid) - once the models
were built, I could just import them into test scripts
yeah. painfully slow.
i can't seem to recreate this on a test script. it happens every so often
in a pyramid app , but I can't recreate it on a bootstrapped (command line)
pyramid instance. my test suite shows this happening instantly.
this has been troubling me for over a week since i
Thanks.
I caved in and stayed up until 3am last night to add a ton of log.debug()
statements across the app.
The culprit was my read-through-caching layer ( built on dogpile ). It was
implemented in such a way that SqlAlchemy looked to have issues.
The performance on the DBM datatstore was
On Thursday, September 26, 2013 11:58:26 AM UTC-4, Michael Bayer wrote:
That's why I don't have a caching function included with SQLAlchemy.
Because then I'd be debugging it, not you :)
Ha!
My caching is pretty lightweight. I do need to figure out a better system
though -- that's for
i think this should work:
query.filter( ~ table.column.contains('%value2%') )
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
I'd be interested in this too.
FWIW, my approach is this:
- flush often
- encapsulate complex logic in 'savepoints' , roll back to them
- fail everything and start from scratch on other errors
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To
is there a way to time the time spent 'loading' an object from the database
?
i think there might be a bottleneck in a part of my application that is
related to the object instantiation.
just to be clear , in this flow:
a) `query.all()`
b) sqlalchemy compiles query
c) sqlalchemy to db
very good. thanks.
i accidentally left a LIMIT off a query. The DB was optimized to return
the results in about .003s ; but it seems to have taken about 2 minutes for
sqlalchemy to generate ~1300 objects from the rows.
--
You received this message because you are subscribed to the Google
On Monday, September 23, 2013 10:31:16 AM UTC-4, Michael Bayer wrote:
it will definitely show the right thing for echo=True, that's what's being
sent to the database.
yeah, the `echo` in my debug log is what showed me that postgres was
getting the right data.
i was doing this to audit
ah ha! yes!
that is right.
query = select( (these,columns,) ).distinct( this.column )
this was an even tricker problem... and I might have been executing
correct queries last night without realizing it.
i just noticed that i was getting a correct query in my database, while I
was
Assuming you're in the ORM, there's also a per-instance delete :
http://docs.sqlalchemy.org/en/rel_0_8/orm/events.html#sqlalchemy.orm.events.MapperEvents.after_delete
but `session.query().delete()` suggests you don't want to load objects into
the ORM, and just want to delete things matching a
This bit...
title = obj.title[en-US] # or something similar
that's very close to how PostgreSQL's HSTORE and JSON columns work with
sqlalchemy.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop
I can't seem to generate a distinct on(column) query ( .8 branch )
i'm using a connection with an ORM session , and working on an alias
this just creates a SELECT DISTINCT column
sqlalchemy.select(
sqlalchemy.distinct(_slurped.c.object_id).label('object_id') ,
_ordered.c.event_timestamp)
Oh crap. I understand.
I was trying to do this:
query = select( func.distinct( columns ) )
and not
query = distinct( columns )
i got thrown off, because the postgres tool is more like a function than an
query , and there's also the .distinct() method you can toss onto a query;
http://docs.sqlalchemy.org/en/rel_0_8/dialects/index.html
Current external dialect projects for SQLAlchemy include:
* sqlalchemy-access https://bitbucket.org/zzzeek/sqlalchemy-access -
driver for Microsoft Access.
https://bitbucket.org/zzzeek/sqlalchemy-access
On Wednesday, September 18,
I'm using the ORM ( though I could be using expressions ) , and have a bit
of code that simply queries for an id + timestamp [ against a join of 6
tables ]
i have another bit of code that performs a similar function. all is well.
I need to , now, join the two codes, and create sql like such :
This is horrible, but it works ( after a few hours of trial error )
the trick was in using labels and aliases in every step
it makes perfect sense looking at it now ( though ugly ), but was not how i
expected to pull this off.
For anyone who gets stuck:
if _query_A and _query_B :
this tripped me up when i was working on some queries.
orm :
distinct( column ) = DISTINCT ON (column)
core :
distinct( column ) = DISTINCT (column)
there doesn't seem to be an easy way to write DISTINCT ON (column) in the
orm
--
You received this message because you are
is there a currently recommended approach ?
looking through the backcatalog of qa (from 2008-2010) , it seems like the
options are:
- manually look at debug data , subtract timestamps for a general idea
- write something with ConnectionEvents ( originally ConnectionProxy )
for now, i just want
it might be better for the recipe to be:
logger = logging.getLogger(sqlalchemy.engine.base.Engine)
logger.setLevel(logging.INFO)
logger.info(Query Complete! Total Time: %f % total)
This will correlate it to the existing sql statement logging ( which is a
way more natural place
On Tuesday, September 17, 2013 3:59:31 PM UTC-4, Michael Bayer wrote:
there's a modern recipe at:
http://www.sqlalchemy.org/trac/wiki/UsageRecipes/Profiling
but yeah, thats ConnectionEvents. what's the issue there, you need how
long result fetching takes ?
thanks!
yeah. Some of the
I just spend 30mins with pdb; I was wrong ; I think it would be way too
hard to get it into the ORM. The way MutableDict seems to be currently
integrated, the entire value is updated for the key , and the original
value seems to be obliterated.
Outside of the ORM -- do you have any references
I might be interpreting all this wrong, but I don't think the
column_property needs to be writable.
I think the situation is this:
Under Postgres, with HSTORE it's possible to INSERT/UPDATE/DELETE only
certain values from within the store.
Under SqlAlchemy, the entire object is
Actually, this is more correct for multi-key updates:
-- select before update
SELECT id, kv-'x' AS kv_x , kv-'y' AS kv_y , kv-'z' AS kv_z FROM
test_class ;
-- update 2 columns ; these 3 are identical
kvkv
UPDATE test_class SET kv = kv || hstore(ARRAY['z','zz','x','xx']);
Sweet. This works :
results = dbSession.execute(
TestClass.__table__\
.update()\
.values( kv = TestClass.__table__.c.kv +
sqlalchemy.dialects.postgresql.hstore(sqlalchemy.dialects.postgresql.array(['zz123',
'zz123'])) )
)
stmt = select( [
On Tuesday, September 10, 2013 6:47:41 AM UTC-4, Dennis wrote:
Thanks for the advice -- your recommendations against this configuration
were a surprise to me...
It's making me rethink what I want (and how much I want it).
I'll post this as a comment to the first stackoverflow question so
Honestly, I wouldn't do this.
Django has a lot of magic under the hood, and it's ORM does some very
specific things to make this magic happen. It's not just the auth, it's
how everything is structured in the database and how the app integrates
with the database. You're likely to break things
In addition to using `func.*` methods, there's also the `extract` method
that works (in most databases) specifically on datetime objects.
sqlalchemy.sql.expression.extract(*field*,
that's less of a SqlAlchemy question and more of a general database
question.
there are a handful of approaches on StackOverflow, and the easier approach
can differ across databases.
try searching for birthdate/birthday range and postgresql or mysql .
I'd suggest that you find one there,
This might be a bug then.
String || Integer ; Integer || String
- PostgreSQL and sqlite both allow for a sting integer to be concat
together into a string. Order does not matter.
Integer || Integer
- PostgreSQL will error if 2 ints are concat together.
- sqlite seems to cast both into a
in general , It's worth reading these 2 sections of the docs if you haven't
already :
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#session-frequently-asked-questions
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#using-thread-local-scope-with-web-applications
--
You received
MyISAM doesn't support transactions, but it does support locking. According
to the docs, it actually relies on table locking for certain operations.
What are your sqlalchemy connection strings for the engine ?
Have you tried explicitly setting autocommit mode within the query ?
Have you tried
On Wednesday, August 28, 2013 12:52:03 PM UTC-4, herzaso wrote:
What's wrong with Member.dateofbirth==datetime.today() ?
datetime.today() is now -- or August 28, 2013 12:52:03 PM UTC-4
The OP wants a sql operation that matches the Month+Day of Member.dateofbirth
to the Month+day of today.
sorry, it looks like the OP did want people born on the current
month/day/year combo.
you should be able to wrap all the comparisons in a date like this :
Member.query.filter( sqlalchemy.func.date(Member.dateofbirth) ==
'2013-08-27' ).all()
Member.query.filter(
this looks a little weird to me, because it seems like you're using parts
of the ORM (namely sessionmaker) and the rest is the Engine.
anyways, you want to address the `table.column`; the results don't exist
yet.
you can print out any query whenever you'd like
below are 2 ways to generate
I had to do this last week.
I posted a recipe in this thread:
https://groups.google.com/forum/#!topic/sqlalchemy/Xr1llnf5tzQ
tracked objects inherit from RevisionObject, which adds 2 columns to the
database:
revision_id (INT)
revision_history (HSTORE)
it also adds 2 methods:
I have this general structure:
class Person:
# orm relationships are preceded by (o)ne or (l)ist
o_Person2Address_ActiveShipping = sa.orm.relationship(
Person2Address, primaryjoin=and_( Person2Address.person_id==Person.id ,
Person2Address.role_id=='active-shipping' ),
On Thursday, August 15, 2013 12:02:02 AM UTC-4, Michael Bayer wrote:
yes it will always be one element for a scalar reference, a collection for
collections. the ORM internally treats everything like a collection, kind
of another artifact that probably wouldnt have been the case if this API
As previously discussed, i'm using an object's history to log changes to
the database within an application.
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html?highlight=history#sqlalchemy.orm.attributes.History
Each tuple member is an iterable sequence
I'm trying to figure out when I
i'm trying to generate a list of non-deffered columns from an object
referencing this example:
class Book(Base):
__tablename__ = 'book'
book_id = Column(Integer, primary_key=True)
title = Column(String(200), nullable=False)
summary = Column(String(2000))
Is there a way to access the changed attributes of an ORM object ?
Everything I've dug up refers to the dirty objects in a session, not the
attributes of an object.
( I'm trying to automate some revision logging /auditing of sqlalchemy
objects )
--
You received this message because you
there's a typo in the docs:
bad:
attr_state = insp.attr.some_attribute
works:
attr_state = insp.attrs.some_attribute
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an
Thanks, Mike!
That let me slap together a quick mixin class to store versioned data (of
specific columns) in PostgreSQL -
class RevisionObject(object):
revision_columns = None
revision_id = sa.Column(sa.Integer, nullable=False, default=0 )
revision_history = sa.Column(
Just for a bit of perspective...
My SqlAlchemy integration for a project is connected to two distinct
applications :
- Pyramid -- Web Application
- Celery -- Background Processing
We're also hoping to get it working on a third
- Twisted -- More Background Work
There are a lot of moving parts
Thanks! This worked:
Document
Document2Image_1 = sa.orm.relationship( Document2Image,
primaryjoin=and_( Document2Image.document_id==Document.id ,
Document2Image.image_type_id==1 ) , uselist=False )
document_image_1 = association_proxy('Document2Image_1', 'image')
--
You received this
I have three tables that are structured somewhat like this:
Document
* id
* all_images = sa.orm.relationship(Document2Image)
Image
* id
* all_documents = sa.orm.relationship(Document2Image)
Document2Image
* id
* document_id
* image_id
* image_type_id
* document = sa.orm.relationship(Document)
Could something be added to the docs then to elaborate on how the context
manager works in regards to how things are committed/rolledback ?
I just added comments to the existing
example (
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html?highlight=begin_nested#using-savepoint
)
the nested transaction / savepoint syntax in sqlalchemy appears to be:
session = SessionFactory()
session.begin() # main tx
session.begin_nested() # outer tx
session.begin_nested() # inner tx
session.rollback() # innter tx
session.commit() #
On Wednesday, July 17, 2013 7:02:10 PM UTC-4, Michael Bayer wrote:
because you can transfer control to some other part of the program that
doesn't know what kind of transaction has started; it only knows it needs
to call commit() or can rollback() if something goes wrong.
It's a simple
On a tangent...
I just noticed that there are several dozen (if not hundreds) of SqlAlchemy
projects on PyPi
Perhaps SqlAlchemy is now large enough that it should have it's own
classifier ?
Something like...
Topic :: Database :: Front-Ends :: SqlAlchemy
Topic :: Database ::
I serialize all my cached data into a dict or json before caching, then
unserialize into whatever object i need.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Mike, thanks again. I finally found time to integrate your
recommendations. https://github.com/jvanasco/pyramid_sqlassist
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an
I have a custom object that I use within my application:
class Foo(bar):
def __init__( self , value=None ):
self.value = value
def __int__
def __str__
def __cmp__
is there any __baz__ method I can use, that will return a value SqlAlchemy
can
actually, nevermind
i just remembered Mike talking about __repr__ last week in his presentation
and I tried that. it works.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an
On Friday, June 21, 2013 2:23:54 PM UTC-4, Michael Bayer wrote:
fairly recently i wrote up as much as I could come up with on this, which
you can see first in the Session FAQ:
http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#session-frequently-asked-questions
and then regarding
Mike blew my mind at the intro to sqlalchemy presentation this week. I
learned at least 5 things that I had missed. I still can't believe that
the connection itself is basically lazy-loaded and SqlAlchemy doesn't
even connect to the DB until you do something. I wrote a bunch of code to
I've been using a utility method 'columns_as_dict' to help store my data in
a cache. It works well.
A problem I've encountered... i need to access the related data that i've
eagerloaded.
My current function looks like this
def columns_as_dict(self):
as_dict = dict(
, at 1:37 PM, Jonathan Vanasco
jona...@findmeon.comjavascript:
wrote:
I've been using a utility method 'columns_as_dict' to help store my data
in a cache. It works well.
A problem I've encountered... i need to access the related data that i've
eagerloaded.
My current function looks like
i'm trying to deal with some old code , and need to 'log' a change. in the
current code block, I do not have a SqlAlchemy session object - i merely
have an ORM object that exists in a given session.
is it possible to extract the session object from that ORM object, so I can
just add a new ORM
this is WONDERFUL. thanks!
On Thursday, May 2, 2013 12:47:25 PM UTC-4, Jonathan Vanasco wrote:
i'm trying to deal with some old code , and need to 'log' a change. in
the current code block, I do not have a SqlAlchemy session object - i
merely have an ORM object that exists in a given
Given
class Person:
id
class Topic:
id
class Person2Topic :
id
topic_id - fkeys topic(id)
person_id - fkeys person(id)
class Message:
id
person_id_author - fkeys person(id)
topic_id - fkeys topic(id)
I wanted to select by joining the Person2Topic table directly, with a
filter
query(
into this. If i don't find a bug in
my code, I'll post a reproducable test-case on github.
On Friday, April 26, 2013 7:18:24 PM UTC-4, Michael Bayer wrote:
On Apr 26, 2013, at 7:10 PM, Jonathan Vanasco
jona...@findmeon.comjavascript:
wrote:
Given
class Person
This seems to work. I'm just hoping to run this past the wisdom of other
users...
SqlAlchemy + PostgreSQL
We have a table called `example` which contains versioned fields of a
record, attributed to an owner.
Goal: assemble a record of the most recent field versions for a given owner
class
FWIW, I've found this sort of stuff to be better done with
CURRENT_TIMESTAMP than NOW() , or doing a NOT NULL constraint with
no-default and passing in a time from the application.
On databases that support it, CURRENT_TIMESTAMP is locked to the
transaction and/or statement while NOW() is
i came up with a novel approach that works, but is sadly not
integrated with SqlAlchemy yet. It was more proof of concept and
creates a parallel Object Model.
It's not good but it's simple and seems to work very well .
I'm just going to braindump what I do. It might give you some
ideas
*
doesn't vertica just implement the postgresql sql set one-to-one ?
i haven't looked at it in a while, but i remember their sales pitch
the trial was all postgres based.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this
much thanks, Audrius
i ended up doing the following (last night) before i read this in the
morning.
1. s/sqlalchemy\.func\.current_timestamp/sql_now/g
2. def sql_now(): return sqlalchemy.sql.text((CURRENT_TIMESTAMP AT
TIME ZONE 'UTC'))
i'm working on implementing your more-proper method now. i
@Femi -
I did a quick search online, but couldn't find any current ( since HP
acquisition ) documentation.
HOWEVER -- all of the old documentation and QAs that are still online
talk about Vertica reimplementing the PostgreSQL syntax and
functions. That's in line with what I remembered earlier,
i need to replace my calls to `sqlalchemy.func.current_timestamp()`
with something that generates CURRENT_TIMESTAMP AT TIME ZONE 'UTC'
anyone have quick advice ?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and
thanks.
i was really focused on the query.filter(sa.or_(*ands)) concept.
that's what seemed kind of weird to me.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
basd on a bunch of error messages, this example works...
criteria = ( ('male',35),('female','35) )
query = session.query( model.Useraccount )
ands = []
for set_ in criteria :
ands.append(\
sqlalchemy.sql.expression.and_(\
ok.
is
from sqlalchemy.sql import func
still the recommended import ?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sqlalchemy+unsubscr...@googlegroups.com.
On Feb 15, 11:17 am, Michael Bayer mike...@zzzcomputing.com wrote:
or just from sqlalchemy import func sure
thanks.
friday is try to pay off technical debt day.
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group
i think this is right...
query= dbSession.query( model.Post )\
filter_by( is_published = True )\
filter(
model.Post.timestamp_publication =
sqlalchemy.sql.expression.current_timestamp()
)
this is generating the right sql. i just wanted to make
ah ha! thanks!!!
these two approaches worked:
results = api.bootstrapped.request.dbSession.writer.execute(
model.core.Useraccount.__table__\
.update()\
.where( model.core.Useraccount.id.in_( uids ) )\
.values( migration_a = True )
when I do stuff like this on the Web (single and multi-page edits), I
build up a dict of 'changes'. When rendering forms, I default to the
key in changes or fallback to the sqlalchemy object. when ready to
save, I copy over the changes to the object - if there are any changes
- and flush.
the
i forgot to add that this all comes from my irrational fear of Little
Bobby Tables ( http://xkcd.com/327/ )
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
i need to search something like this:
select name from users where name ilike '%jonathan%';
i know i could do this:
dbSession.query( models.User )\
.filter( models.User.name.ilike( %%%s%% % 'jonathan' )
but the name is coming from the web, so i want treat it with a bind,
like
How about using
dbSession.query(models.User).filter(models.User.contains(name))
That generates a LIKE statement , not an ILIKE. I need to case-
insensitive match. as a stopgap, i might be able to chain a lower()
in there, but something like this should be support.
also i'm not so sure
On Jan 29, 2:04 pm, Michael Bayer mike...@zzzcomputing.com wrote:
ilike is available using column.ilike(some string). You can turn it into
a contains by adding in the appropriate % signs manually. If you want to
do lower() manually, then you can say func.lower(column).contains('some
901 - 1000 of 1035 matches
Mail list logo