Re: Binding and custom types...

James Henstridge <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Fri, Jun 12, 2009 at 1:18 AM, Douglas Mayle <[email protected]> wrote:
> I wish I had that leeway, I've been trying to accomplish just that, but
> failing that, I was looking for a workaround...

Perhaps you are tackling this from the wrong layer.  You can probably
teach SQLAlchemy about your ST_TRANSFORM and have it generate the
correct SQL.

I haven't used SQLAlchemy, but with other Python ORMs (Storm and
SQLObject) you would be able to create an st_transform object and
write stuff like:

    obj.location = st_transform("SRID=...", 2163)

The ORM would then recognise the construct and put an appropriate
function call in the generated SQL.

James.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.