I'm having a problem when I try to create a queryset with a call to filter() and extra(). No matter what operator I use when generating the expression I end up with an SQL query that ANDs the filter() and extra() parameters, rather than ORing them.
Example: <<< code >>> class ProjectManager(models.Manager): def search(self): q = Q(title__icontains='test') where = ["EXISTS(SELECT * FROM mart_project_skills WHERE "\ "mart_project_skills.project_id=mart_project.id AND mart_project_skills.skill_id IN (1, 2, 3))"] results_set = self.extra(where=where) | self.filter(q) # note I'm using the | operator <<< produced SQL >>> SELECT `mart_project`.`id`,`mart_project`.`created_on`,`mart_projec t`.`buyer_id`,`mart_project`.`title`,`mart_project`.`description`,`mart _project` .`deadline`,`mart_project`.`budget_max`,`mart_project`.`featured`,`mart _project` .`winning_bid_id`,`mart_project`.`kind`,`mart_project`.`status` FROM `mart_proje ct` WHERE EXISTS(SELECT * FROM mart_project_skills WHERE mart_project_skills.pro ject_id=mart_project.id AND mart_project_skills.skill_id IN (1, 2, 3)) AND (((`mart_p roject`.`title` LIKE %test%))) How can I tell the queryset to use an OR operator between the 'where' clause and the conditions set-up in the Q object? Thanks in advance, David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---