that won't work as you expect.
You're applying the python character replacements to the arguments, and
then emitting that in sql. You'll end up with the same
InstrumentedAttribute issue, because you're trying to operate on the Python
column instance in the orm defintion.
the string returned by the custom compiler should be a sql function,
"""REPLACE(REPLACE(REPLACE(%s, CHR(9), ''), CHR(10), ''), CHR(13),
'')"""" % compiler.process(args)
That would create sql from your example that reads:
SELECT REPLACE(REPLACE(REPLACE(<whatever the dynamic table/column alias
is>, CHR(9), ''), CHR(10), ''), CHR(13), '') LIMIT 1;
If you just want to insert data, you could just use a python function that
does that string cleanup.
The Python SQL Toolkit and Object Relational Mapper
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.