On 6/13/07, Roger Demetrescu <[EMAIL PROTECTED]> wrote: > > Hi Michael, > > On 6/13/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > > > On Jun 13, 2007, at 8:48 AM, Roger Demetrescu wrote: > > > But the use of this function is to ugly to my taste (I know, the > > > "give_me_pk_values_in_correct_order" is too big here): > > > > > > customer = session.query(Customer).get > > > (Customer.give_me_pk_values_in_correct_order(dict(columnX=3, > > > columnY=4, columnZ=343)) > > > > > > Having to repeat Customer reference twic annoys me... :) > > > > > > > its python ! its, "there should be only one way to do it", "we're > > taking away map() and reduce() because you already have list > > comprehensions". theres all kinds of things you might want to pass > > to get(), how would I know how you want to translate it ?
Well, from my understanding, the spirit of get is to "fetch something that you already know the primary key for", so supporting them in the form of a dictionary seem pretty natural to me. > Indeed different people will have different opinions how things should > work.... > In my case, passing a dict() in query.get() was so intuitive to me, > that I got a little > frustrated when noticed it didn't work ... Same here. > If query.get() is smart to > deal with a sequence (eg: list or tuple), why it shouldn't be with a > mapping ? :) > > Anyway, a couple of custom utilities functions will definitely do the job > here.. Indeed. No worries, I'll survive this... It's not something I come across that often anyway. It just felt natural to be able to do it. -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---