Hi django-users :) I'm currently working on my first real django project and got stuck using the DB API: I defined these models:
---snip--- class RequestParameters(models.Model): parameter = models.CharField(max_length=64) value = models.CharField(max_length=64) class Request(models.Model): locale = models.CharField(max_length=32, default=LOCALES[1][0], choices=LOCALES) lastCheck = models.DateTimeField(blank=True, null=True) parameters = models.ManyToManyField(RequestParameters) users = models.ManyToManyField(User) ---snip--- And I'm trying to query for an Item with two "RequestParmeter"s (both of them, mysql AND) I thought I could use two Q Objects and combine them using & but for some reason this will not work: ---snip-- In [309]: Request.objects.filter(Q(parameters=1)) Out[309]: [<Request: 1>, <Request: 2>] In [310]: Request.objects.filter(Q(parameters=2)) Out[310]: [<Request: 1>, <Request: 2>, <Request: 3>] In [311]: Request.objects.filter(Q(parameters=1)&Q(parameters=2)) Out[311]: [] ---snip--- Can someone point me to my error? thanks in advance, chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---