Thanks Michael. I will try your suggestion.

But I would like the date context to be applied while executing and
not actually modify the select statement to support the use-case where
I have a select statement and would the same select to be executed in
different date contexts.

=======================================
t1 = table('t1', column('a'), column('b'), column('c'))

s = select([t1])

With DateContext(b = 12)
    conn.execute(s)                ----> This would actually execute
"select a, b, c from t1 where b = 12"

With DateContext(b = 13)
    conn.execute(s)               ------> This would actually execute
"select a, b, c from t1 where b = 13"
========================================


Also I have these questions

1. Can we acheive the same thing if user uses sessions to query

  With DateContext(b = 12):
       result = session.query(MyObj)        ---> b =12 condtion should
be automatically applied here.


2. Can we acheive the same thing with updates/inserts and not just
with selects




-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to