[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Roger Demetrescu
Hi Michael, 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... :)

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Marco Mariani
Roger Demetrescu ha scritto: query.get(dict(columnB='foo', columnA='bar') Lazy programmers are the best ones... :) That's the reason lazy programmers share a superclass for all their domain objects... hint, hint :-) --~--~-~--~~~---~--~~ You received

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread sdobrev
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

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Roger Demetrescu
On 6/13/07, Marco Mariani [EMAIL PROTECTED] wrote: Roger Demetrescu ha scritto: query.get(dict(columnB='foo', columnA='bar') Lazy programmers are the best ones... :) That's the reason lazy programmers share a superclass for all their domain objects... hint, hint :-) Yeaph, I

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Roger Demetrescu
On 6/13/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: 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',

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Michael Bayer
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,

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread sdobrev
well, if u dont want to write the same thing over and over, write one wrapping function, and publish it here. e.g. something like (pseudocode): def _get_pk_ordered( klas): table = orm.mapper.registry(klas).mapped_table #or select_table return whatever-list-of-columns def

[sqlalchemy] Re: Query.get with unordered multiple-column-primary-key

2007-06-13 Thread Gaetan de Menten
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