Re: Magic-removal query syntax

2006-03-21 Thread Adrian Holovaty
On 3/21/06, Christopher Lenz <[EMAIL PROTECTED]> wrote: > Has something like the following syntax been discussed here before? > >Article.objects.filter(Article.author.name == 'fred') >Article.objects.filter(Article.author.name.contains('fred')) >etc Yeah, that's been discussed and sho

Re: Magic-removal query syntax

2006-03-21 Thread Christopher Lenz
Am 19.03.2006 um 08:12 schrieb Max Battcher: > Russell Keith-Magee wrote: >> You still need to parse kwargs to handle queries across joins (e.g., >> Article.objects.filter(author__name__exact='fred')) > > Just playing around with ideas, but what if you could do something > like: > > Article.obje

Re: Magic-removal query syntax

2006-03-18 Thread Max Battcher
Russell Keith-Magee wrote: > You still need to parse kwargs to handle queries across joins (e.g., > Article.objects.filter(author__name__exact='fred')) Just playing around with ideas, but what if you could do something like: Article.objects.filter(author=Author.objects.filter(name='fred')) It's

Re: Magic-removal query syntax

2006-03-18 Thread Max Battcher
Eugene Lazutkin wrote: > What was the motivation behind using complex kwargs like (taken from > http://code.djangoproject.com/wiki/RemovingTheMagic): The complex kwargs predate magic-removal. Most of the magic kwargs are slowly disappearing, too, like the sudden recent introduction of .exclud

Re: Magic-removal query syntax

2006-03-18 Thread Eugene Lazutkin
Russell Keith-Magee wrote: > > Interesting, but I'm not sure I see the advantage. I don't think this > notation is inherently more obvious, and I don't see any use cases > that the existing notation does not service, but this notation would > be able to service. I don't see either. It is a pure

Re: Magic-removal query syntax

2006-03-17 Thread Russell Keith-Magee
On 3/18/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > > Why don't we use something simple, like tuples: > > pubdate=('year', 2005) > name='John' (it is possible now) > fname=('contains','n') Interesting, but I'm not sure I see the advantage. I don't think this notation is inherently more obvio

Re: Magic-removal query syntax

2006-03-17 Thread Malcolm Tredinnick
On Fri, 2006-03-17 at 19:30 -0600, Eugene Lazutkin wrote: > What was the motivation behind using complex kwargs like (taken from > http://code.djangoproject.com/wiki/RemovingTheMagic): > > pubdate__year=2005 > > fname__contains='n' > name__exact='John' (can be abbreviated to name='John') > and

Re: Magic-removal query syntax

2006-03-17 Thread Eugene Lazutkin
Eugene Lazutkin wrote: > What was the motivation behind using complex kwargs like (taken from > http://code.djangoproject.com/wiki/RemovingTheMagic): > > pubdate__year=2005 > > fname__contains='n' > name__exact='John' (can be abbreviated to name='John') > and so an? > > Why don't we use someth

Magic-removal query syntax

2006-03-17 Thread Eugene Lazutkin
What was the motivation behind using complex kwargs like (taken from http://code.djangoproject.com/wiki/RemovingTheMagic): pubdate__year=2005 fname__contains='n' name__exact='John' (can be abbreviated to name='John') and so an? Why don't we use something simple, like tuples: pubdate=('year',