On 12/6/05, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
> As (my) knee-jerk reaction, don't take Aaronsw's criticism so much to heart.
> :)
>
> He's got some points, but his is just one more opinion (and web tool).
A bunch of this stuff was discussed by me, Jacob and Simon this
weekend, so it's not entirely based on the criticism. That said, Aaron
had some good points. Some bad ones, too, of course.
> What was the original rationale for the id__exact=1 approach, and how
> does the new way improve upon it?
The original rationale was that you shouldn't have to import a magic
object in order to use lookups in a database query. In the following
example, I would define "Person.q" as the magic object, because its
sole purpose is to provide a "hook" for query parameters.
people.get_list(Person.q.first_name='Jeremy')
But my rationale for changing to the magic object approach is: If we
move to class-based lookups (Person.objects.get_list() rather than
people.get_list()), the class will have been imported *anyway*, so
it's not too much of a big deal to have to use it.
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org