[sqlalchemy] User defined type with custom SQL?

2012-11-18 Thread Vlad K.
Hello list, I can't find an example for a user defined type that has to produce custom SQL. What I want is to implement a PostGIS geometry column and it basically has to do two things: 1. Implement own SQL for insert/update, to produce for example: INSERT INTO (..., xyzzy, )

Re: [sqlalchemy] User defined type with custom SQL?

2012-11-18 Thread Michael Bayer
There's a lot of documentation on this, not sure how you're not finding it, unless you're not using 0.8 (which is required): 1. documentation for SQL bind/result column processing: http://docs.sqlalchemy.org/en/latest/core/types.html#types-sql-value-processing 2. a full example using PostGIS:

[sqlalchemy] postgres timestamp at time zone

2012-11-18 Thread espresso maker
Hi, I have a table 'my_log' with a created_at column of type timestamp with time zone; class Log(Base): __tablename__ = my_log created_at = Column(DateTime(timezone=True), nullable=False, server_default=func.now()) I would like to query Log and