Re: Database querying in Django

2005-12-02 Thread Brant Harris
On 12/1/05, Brant Harris <[EMAIL PROTECTED]> wrote: > Alright, I'll get up a ticket as soon as I can. > As promised: http://code.djangoproject.com/ticket/980 It explains not only the system but my reasoning.

Re: Database querying in Django

2005-12-01 Thread Brant Harris
I think the arguing about the color of the bikeshed thought is mis-placed here. I'm not offering feedback, i.e. arguing that the bikeshed is painted the wrong color, I'm offering an idea, a patch, real code. But, I obviously didn't present my idea well enough, so I will present it in wiki form

Re: Database querying in Django

2005-12-01 Thread Jacob Kaplan-Moss
Hey Brent -- Thanks for your feedback. However, as I see it, arguing about the syntax that an ORM should use is just a rehashing of the argument over what color to paint the bikeshed (http://www.unixguide.net/freebsd/faq/16.19.shtml). The fact is that there's a serious mismatch between

Re: Database querying in Django

2005-12-01 Thread oggie rob
Yes, it is a little ugly. I would suggest that you put the Q arguments outside of your query for readability (also for those 'subqueries' you were talking about): hello = Q(headline__startswith='Hello') bye = Q(headline__startswith='Goodbye') articles.get_list(complex=(hello | goodbye)) As

Re: Database querying in Django

2005-12-01 Thread Robert Wittams
Brant Harris wrote: > > SQL: > SELECT * FROM `documents` WHERE ((something > 2 AND other < 4 AND > other LIKE 'hi%') OR (something < 4)) > > I've coded this out completely, so it's not a pipe-dream. If there is > more interest I can provide such code. > It'd be interesting to look at. I for

Re: Database querying in Django

2005-12-01 Thread Eugene Lazutkin
I've read it. I think the author is under false impression that ORM is supposed to provide better/simpler alternative to SQL. It is not the goal of ORM. ORM is about bridging SQL with systems written in conventional computer languages. Usually it is assumed that the system is OO-based, hence O

Database querying in Django

2005-12-01 Thread Brant Harris
Jonathan Ellis left a pretty brutal attack about Django's ORM on his blog today that I picked up from Planet Python, and I got to thinking about it. I don't quite agree with him on many of his points. But I did agree that the OR syntax, as it stands, is rather ugly. So I was trying to think of