>
> Some of my coworkers had the same needs of Gaetan... And while I
> understand your solution, I figure out if SA could have it natively
> (detecting the presence of a dictionary)...
>
> Somethink like:
>
>
> query.get(dict(columnB='foo', columnA='bar')
> Lazy programmers are the best ones...  :)

why not query.get(**dict(columnB='foo', columnA='bar')) ?
it should work as is..


>
> On 6/12/07, Michael Bayer <[EMAIL PROTECTED]> wrote:
> > look through the keys in [c.key for c in table.primary_key],
> > match those up
> >
> > i.e.
> >
> > query.get(*[mydict[c.key] for c in table.primary_key])
> >
> > On Jun 12, 1:07 pm, "Gaetan de Menten" <[EMAIL PROTECTED]> 
wrote:
> > > Hi,
> > >
> > > Anybody knows how I could emulate the behavior of Query.get (ie
> > > get the result from the session if possible instead of always
> > > fetching from the db) if I have the values for the different
> > > columns of the primary as keyword arguments (ie not in the
> > > order of the columns of the initial table)? I need a kind of a
> > > mix between get_by and get. Any idea?
> > >
> > > --

--~--~---------~--~----~------------~-------~--~----~
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