i think all that stuff works in 4.x too
you can also do object methods like :
dbSession.query(self.__class__).from_statement( "SQL start = :start
" ).params( start=start , limit=limit ).all()
and object tuples like:
def get__emails__unconfirmed( self, dbSession , date_start=None ,
date_end=None ):
"""
returns a sqlalchemy.engine.base.ResultProxy object that
has 'email,nickname,id,osn_email_address_id' as the attributes
"""
sql= sqlalchemy.select(
[ (self.__class__).c.email , 'nickname', 'id' ,
'osn_email_address_id' ] ,
sqlalchemy.sql.and_(
"is_verified IS NOT True",
(self.__class__).timestamp_registered >= date_start ,
(self.__class__).timestamp_registered <= date_end
),
order_by=['id']
)
return dbSession.execute( sql )
and general tuple stuff like:
from sqlalchemy.sql import text
sql= text( "SQL item_id = :item_id ")
return dbSession.connection().execute( sql , item_id=item_id ,
start=start , limit=limit ).fetchall()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---