On Mar 8, 2007, at 11:49 AM, Jonathan Ellis wrote:

> for instance, i have an application in charge of building zips for
> users to download from a queue of requests.  the requests are
> prioritized, but to prevent starvation of low priority requests, i
> have another thread that just processes them in order of request time.
>
> so i have the base query that's just a module-level variable, and the
> main threadpool adds on the priority clause, while the other adds on
> the request-time clause.

well say you have your query

myquery = session.query(SomeClass).select(<whatever>)

your functions that want to build off of it without modifying can  
just say:

def dosomething():
     q = myquery.copy().where(<something>).where(<somethingelse>)

so if you do need a local query, you can get one.  i think this is  
the less common use case, so the extra typing should be associated  
there (and its not as much extra typing as the "q= q.foo" thing).


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to