[sqlalchemy] Add an integer column as seconds to a datetime column in filter

2015-01-15 Thread Guido Winkelmann
Hi, How can I add one column containing integer values (NULL allowed), treating them as seconds, to another column from the same table containing datetime values and compare the result to the current time? I have a table with a datetime column finished_on and in int column wait. Once wait

Re: [sqlalchemy] Access raw python class after mapping took place.

2015-01-15 Thread Dimitris Theodorou
I should have clarified, I am only using declarative. The classical mapping example I wrote to illustrate the pure class that I wanted to extract out of a declarative class, with the intent to inherit the plain python behavior but none of the sql alchemy attributes. Thanks for bringing

[sqlalchemy] Access raw python class after mapping took place.

2015-01-15 Thread Dimitris Theodorou
Hi, I am looking to retrieving the pure python class that participates in a mapping. I would like to do this **after** the mapping took place and modified/extended the class' attributes. For instance, with this code class Thing(object): def __init__(self, id=None, name=None): self.id =

Re: [sqlalchemy] Access raw python class after mapping took place.

2015-01-15 Thread Michael Bayer
Dimitris Theodorou dimitris.theodo...@gmail.com wrote: Hi, I am looking to retrieving the pure python class that participates in a mapping. I would like to do this **after** the mapping took place and modified/extended the class' attributes. For instance, with this code class

[sqlalchemy] Re: ORM code example for a query of a single table

2015-01-15 Thread Jonathan Vanasco
Take a look at sqlacodegen https://pypi.python.org/pypi/sqlacodegen/ It can build the Python classes (sqlalchemy declarative) from your existing database. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and

Re: [sqlalchemy] triple quoting of upper case foreign keys

2015-01-15 Thread Владислав Белогрудов
Thanks a lot for your reply, Michael! On Wednesday, January 14, 2015 at 7:36:40 PM UTC+3, Michael Bayer wrote: Владислав Белогрудов vlad.be...@gmail.com javascript: wrote: Hi everyone, I am testing sqlalchemy-migrate coupled with sclalchemy. My table has constraint with

Re: [sqlalchemy] Add an integer column as seconds to a datetime column in filter

2015-01-15 Thread Michael Bayer
you should be able to cast as interval: from sqlalchemy.dialects.postgresql import INTERVAL from sqlalchemy import cast select([test]).where(test.c.finished_on + cast(‘1 sec’, INTERVAL) * test.c.wait func.NOW()) Guido Winkelmann gu...@ambient-entertainment.de wrote: Hi, How can I add

[sqlalchemy] ORM code example for a query of a single table

2015-01-15 Thread SF Markus Elfring
Hello, I would like to query a single table by the ORM interface for an export of the stored data into an other file format. The description of the query API refers also to the object relational tutorial. This tutorial explains also functionality which deals with table creation. I imagine that I