Re: two different models, order by date

2010-02-24 Thread Timothy Kinney
I agree with Pablo. Don't start designing queries until you've designed your database relations, because the queries are meaningless if you change relationships. Sit down with a piece of paper and list or draw bubbles or whatever so that you can establish what your models are, what the fields are

Re: two different models, order by date

2010-02-24 Thread Pablo Ilardi
I'd say that the effort of doing it depends on the db structure, if both models share tables or are under the same table hierarchy then, you can create a single query based on the common parent (though you'll only retrieve objects of the parent model and you'll have to determine somehow later what

Re: two different models, order by date

2010-02-24 Thread Jirka Vejrazka
Hi, > i have a simple question here, i've been trying to found the answer > but somehow i got confused if this is wheter possible or not: it's always possible, just a matter of time and effort (and cost) ;-) > I have two django models, movies and books , i want to get all the > objects from bo

Re: two different models, order by date

2010-02-24 Thread Damian
yep, im getting the same error. i believe what im asking is not possible , but i really really hope im wrong :) On Wed, Feb 24, 2010 at 7:02 AM, Matt Schinckel wrote: > On Feb 24, 6:59 am, Nick wrote: >> In the view set up something like >> >> all = [Books.objects.all() & Movies.objects.all()

Re: two different models, order by date

2010-02-24 Thread Matt Schinckel
On Feb 24, 6:59 am, Nick wrote: > In the view set up something like > > all = [Books.objects.all() & Movies.objects.all()].orderby('date') > I thought: "super, I have been looking for this", but: "Cannot combine queries on two different base models." Matt. > On Feb 23, 2:22 pm, ds wrote: > >

Re: two different models, order by date

2010-02-23 Thread Nick
In the view set up something like all = [Books.objects.all() & Movies.objects.all()].orderby('date') On Feb 23, 2:22 pm, ds wrote: > Hello group, > > i have a simple question here, i've been trying to found the answer > but somehow i got confused if this is wheter possible or not: > > I have two

two different models, order by date

2010-02-23 Thread ds
Hello group, i have a simple question here, i've been trying to found the answer but somehow i got confused if this is wheter possible or not: I have two django models, movies and books , i want to get all the objects from both models and order them by date, getting result_set that might look lik