Re: Django database API - What is it good for?

2007-08-13 Thread TheMaTrIx
Also, if I'm not mistaken, when you use the database api, the input validation steps are taken care of by the framework, you don't just tell in the models what format fields should be in the database, but at the same time are telling the framework what input it should accept for that field. If a f

Re: Django database API - What is it good for?

2007-08-13 Thread Collin Grady
> >>> users = User.objects.filter(groups__contains="Staff") ? This line doesn't work because "groups" is a ManyToManyField, not a CharField, so __contains="Staff" doesn't make any sense. Something like users = User.objects.filter(groups__name="Staff") should work a little better :) --~--~-

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, Amirouche <[EMAIL PROTECTED]> wrote: > What do you mean, I can't understand. OK, suppose you are running an online store, so you have a database table "orders", which lists orders customers have placed, and another "addresses" which lists the addresses to ship the orders to. To calcul

Re: Django database API - What is it good for?

2007-08-13 Thread Amirouche
On Aug 13, 3:19 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 8/13/07, sagi s <[EMAIL PROTECTED]> wrote: > > > Surely not. It is... darn - Can I just use SQL and be done with it? > > Of course. > > But keep in mind that, when programming in an object-oriented > language, it's often more us

Re: Django database API - What is it good for?

2007-08-13 Thread James Bennett
On 8/13/07, sagi s <[EMAIL PROTECTED]> wrote: > Surely not. It is... darn - Can I just use SQL and be done with it? Of course. But keep in mind that, when programming in an object-oriented language, it's often more useful to get back a set of domain-specific objects -- which requires using Djang

Django database API - What is it good for?

2007-08-13 Thread sagi s
I've been playing around with Django for a couple of weeks. I'm finding myself spending most of my type tinkering with the Database API to try to wrestle the information I need out of my database. At this point it looks to me like I have replaced one set of incantations (SQL) for another (Databa