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, 
something like:

    """REPLACE(REPLACE(REPLACE(%s, CHR(9), ''), CHR(10), ''), CHR(13), 
'')""""  % compiler.process(args[0])

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.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

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 
"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.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to