On 6 Dec 2005, at 21:00, Adrian Holovaty wrote:
Thoughts?
http://code.djangoproject.com/wiki/RemovingTheMagic
I really like almost all of it. My one hang-up is this:
Person.objects.get_list(Person.q.first_name == 'Adrian')
I like the Person.objects bit, but I'm not so keen on
Person.q.first_name - it's pretty verbose.
How about supporting an SQL where clause, as seen in Rails?
Person.objects.get_where('first_name = %s and last_name = %s',
'Adrian', 'Holovaty')
Escaping would have to be handled in a backend dependant way, but
this would solve a lot of our ugly syntax problems. We could keep the
old method around for cases where database independent SQL generation
is needed.
Cheers,
Simon