On Friday, 10 January 2014 17:52:45 UTC, Michael Bayer wrote: > > there’s various patterns for dealing with the very common issue of “create > unique object if not exists, else use the current one”. One that I > frequently point to is the unique object recipe: >
OK, so looking at that seems to imply that pkg = Package(name="pip") session.add(pkg) is_it_there = session.query(Package).filter(Package.name == 'pip').first() assert is_it_there is pkg will fail the assertion (unless there is a flush). Otherwise, I don't see why the unique cache is needed in the recipe you reference. I think I'm still missing something here... Paul. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.
