On Sat, 2007-02-10 at 08:30 +0800, Russell Keith-Magee wrote: > On 2/10/07, David Abrahams <[EMAIL PROTECTED]> wrote: > > > > Use natural operators for filtering, excluding, and attribute > > access. > > > How about it? > > Some immediate problems: > > - Your syntax works for < > <= >= and ==; but what about all the other > Django query operators? How do you come up with a clean representation > for startswith? istartswith? range? month?
Maybe I'm missing something, but I don't see how this can work at all. When Python sees "_.foo >= 6", it is going to evaluate it at runtime (before calling the function). However, we need the SQL construction code to see the ">=" bit so that we can pass the right operator through to the database. So I believe there is a bigger problem here: Python's syntax parser won't allow us to get the right information. Using the "foo__gte = 6" syntax, we get the whole parameter name and can turn the __gte portion into the right SQL operator. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---
