Re: Lookup across relations

2009-03-25 Thread 3xM
An upgrade to Ubuntu 8.10 with Django 1.0 solved the problem. Thanks for all your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Lookup across relations

2009-03-18 Thread Brett Parker
On 18 Mar 18:03, Malcolm Tredinnick wrote: > > On Wed, 2009-03-18 at 08:00 +0100, Matías Costa wrote: > > On Tue, Mar 17, 2009 at 9:28 PM, 3xM <3...@detfalskested.dk> wrote: > > I'll upgrade to Ubuntu 8.10 (with django 1.0) as soon as > > possible and > > get back to tell

Re: Lookup across relations

2009-03-18 Thread Malcolm Tredinnick
On Wed, 2009-03-18 at 08:00 +0100, Matías Costa wrote: > On Tue, Mar 17, 2009 at 9:28 PM, 3xM <3...@detfalskested.dk> wrote: > I'll upgrade to Ubuntu 8.10 (with django 1.0) as soon as > possible and > get back to tell if solved the problem. > > > I imagine you

Re: Lookup across relations

2009-03-18 Thread Matías Costa
On Tue, Mar 17, 2009 at 9:28 PM, 3xM <3...@detfalskested.dk> wrote: > I'll upgrade to Ubuntu 8.10 (with django 1.0) as soon as possible and > get back to tell if solved the problem. > I imagine you can upgrade django without upgrade the whole OS. Try to uninstall 0.96 (apt-get), download 1.1 and

Re: Lookup across relations

2009-03-16 Thread Malcolm Tredinnick
On Mon, 2009-03-16 at 17:29 +0100, Matías Costa wrote: [...] > > BTW, this is Django 1.0, I had to rename your maxlength field > parameter to max_length. Are you using 0.96? Oh, dear. If the original poster is using 0.96, then this has little chance of working. Complex queries involving

Re: Lookup across relations

2009-03-16 Thread Matías Costa
2009/3/16 Matías Costa > On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > >> >> Gees... It messed with my link. I'll try again: >> http://blackfin.cannedtuna.org/django-testcase.tar.gz >> >> >> > It works OK here. I have added __rerpr__ method to

Re: Lookup across relations

2009-03-16 Thread Matías Costa
On Sun, Mar 15, 2009 at 2:54 PM, 3xM <3...@detfalskested.dk> wrote: > > Gees... It messed with my link. I'll try again: > http://blackfin.cannedtuna.org/django-testcase.tar.gz > > > It works OK here. I have added __rerpr__ method to models to get a clear output: for p in Project.objects.all():

Re: Lookup across relations

2009-03-15 Thread 3xM
Gees... It messed with my link. I'll try again: http://blackfin.cannedtuna.org/django-testcase.tar.gz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Lookup across relations

2009-03-15 Thread 3xM
So, now I had the time to create at clean test case. it can be downloaded here: It contains a few views etc. to show the data in the database (in sqlite3 format, also included in the .tar.gz). Now, if I go into django's interactive shell

Re: Lookup across relations

2009-02-22 Thread Malcolm Tredinnick
On Sun, 2009-02-22 at 22:56 +0700, Reza Muhammad wrote: [...] > > Doesn't work either. This one returns no results, just like chaining > > filters. > > > I think the above was just a clue, if you need "OR" condition instead > of "AND", you need to use "|" not "&" so: > >

Re: Lookup across relations

2009-02-22 Thread Reza Muhammad
On Feb 22, 2009, at 5:44 PM, 3xM <3...@detfalskested.dk> wrote: > > > > On Feb 21, 10:33 pm, Daniel Roseman > wrote: > >> No need for custom SQL here. This might work: >> Project.objects.filter(persons=person_a, persons=person_b) > > Nope. It just returns

Re: Lookup across relations

2009-02-22 Thread 3xM
On Feb 21, 10:33 pm, Daniel Roseman wrote: > No need for custom SQL here. This might work: > Project.objects.filter(persons=person_a, persons=person_b) Nope. It just returns projects including person_b. > Or you could probably do it with Q objects: >

Re: Lookup across relations

2009-02-21 Thread Daniel Roseman
On Feb 21, 7:27 pm, 3xM <3...@detfalskested.dk> wrote: > I've got 2 models: > > > class Person(models.Model): >     ... > > class Project(models.Model): >     ... >     persons = models.ManyToManyField(Person) > > > Now, how do I lookup Projects including person_a and person_b? > > I've

Lookup across relations

2009-02-21 Thread 3xM
I've got 2 models: class Person(models.Model): ... class Project(models.Model): ... persons = models.ManyToManyField(Person) Now, how do I lookup Projects including person_a and person_b? I've tried chaining filters like this, but that won't work (returning no results):