I've got a 'system' table which has a foreign key client_id to a
'client' table, and that has a FK vendor_id to a 'vendor' table.
Currently I query and order by client_id and system attribute like::
systems = self.session.query(System).select(or_(System.c.lastseen == None,
I finally discovered the Using Bind Parameters in Text Blocks
section of the SQLAlchemy manual -- very useful and very easy to use.
Perhaps this will help others who are trying to search against MySQL's
FULLTEXT index safely. FWIW, I'm doing this in Pylons.
Here's what I ended up doing:
t
I'm doing a query against a MySQL table that has a column which has
a fulltext index, so I need to do some raw-ish queries. Problem is
that these open me up to SQL injection attacks. How do I avoid them --
bound variables? filtering of quotes and funny chars?
I create the index on a table
I'd be interested in how you work this out as I want to do something
similar. Would you be willing to write it up and perhaps post it to
the wiki?
I was able to get MySQL's fulltext search working more quickly than
PostgreSQL's and that's what my customer is used to so that's what I'm
going to
I've got a bunch of history and other timestamped information I will
need to query against. The columns are created with type DateTime and
get set upon row creation:
history_table = Table(
'history', metadata,
Column('history_id', Integer,primary_key=True),
I'm doing a Pylons app and must be doing something stupid because
similar logic seems to work elsewhere, but this just
isn't sticking in the DB. I query to get existing 'contacts',
they're empty so I create a new one, append it, save and flush, but it
doesn't show up in the diagnostic queries I
Doh, I should have turned on the SQL echo. Now that I have, it's even
more puzzling to me. It shows the 'contact' being inserted and
committed -- but it never appears in MySQL!
2006-12-23 17:33:15,140 INFO sqlalchemy.engine.base.Engine.0x..cc BEGIN
2006-12-23 17:33:15,145 INFO
Michael Bayer [EMAIL PROTECTED] writes:
seems like Pylons is not properly maintaining the session within
requests.
Yeah, it sure feels like that. :-(
unless there is some way you can reproduce this problem
without any dependencies on pylons ? is this using the newest
SA/Pylons code that
Michael Bayer [EMAIL PROTECTED] writes:
func.current_timestamp() (which evaulates without the parenthesis in
SQL)
Excellent, works like a charm. Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups