Re: [sqlalchemy] mixing association proxies and mixin classes

2012-06-21 Thread Wichert Akkerman
That works like a charm, thanks! On 06/21/2012 12:46 AM, Michael Bayer wrote: do it like this for now: class FilterMixin(object): @declared_attr def _filters(cls): cls.filters = association_proxy('_filters', 'filter') return relationship(cls.filter_class,

[sqlalchemy] Retrive datetime attributes

2012-06-21 Thread fribes
Hi all, I'm using Python 2.6.5 and SQLAlchemy-0.7.8 over sqlite3 to store and retrieve logs with in table like this : class LogEntry(Base): Log class __tablename__ = 'log' #common data id = Column(Integer, primary_key=True) timestamp = Column(DateTime()) When querying back

[sqlalchemy] Re: Retrive datetime attributes

2012-06-21 Thread GHZ
Here is code that works for me: from datetime import datetime from sqlalchemy import Column, DateTime, Integer, create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.ext.declarative import declarative_base engine = create_engine('sqlite://', echo=True) Base =

Re: [sqlalchemy] Understanding memory usage under SQLA

2012-06-21 Thread Vlad K.
On 05/17/2012 05:09 PM, Claudio Freire wrote: Precompiling queries in SQLA, to populate the various SQLA's compiler caches, doing some queries that cause libpq and psycopg2 to excercise (and thus to allocate whatever permanent data structures it needs to), all at load time, will help keep

Re: [sqlalchemy] Re: Retrive datetime attributes

2012-06-21 Thread fribes
Thanks! Here is a slightly modified version that shows what happens : if querying in another session, with a from_statement, the string is not processed. Is it the expected behaviour ? from datetime import datetime from sqlalchemy import Column, DateTime, Integer, create_engine from