Big fan, first post.

I need to store a result set and subsequently act on it ( add to set,
select from set, remove from set, etc.) in ways that stored filters
can't accommodate; lots of arndom serial steps, removing and adding
specific records, filtering by the results of other joined table
queries, etc.

There are two ways I've done this in the past.  Both work, but leave
me queasy.

1. Store a list of ids, and use them accordingly, ie:

     # My current query
     query = query.filter( ... )

     # And I'm selecting from a previous set
     query = query.filter( or_( *[ MyObject.c.id==id for id in
result_set ] ) )

    ...

    # And then store this set
    result_set = [ obj.id for obj in col ]

2. Create and subsequently alter a table in the database with one
field (id) that I use to join to the table I'm querying.  This is a
unique table for each user that eventually gets cleaned up.

Neither method seems optimized nor scalable.  Large sets make the
former unwieldy, many users make the later troublesome.  Any thoughts
on a better way?

Thanks,

Adam

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to