I solved in this way but maybe there's a better way to do it: organizs = Organization.objects.filter(organization_name__icontains=data['organization_name'])
for n in range(len(organizs)): for m in range(organizs[n].person.count()): for i in range(result.count()): if (organizs[n].person.all()[m].username == result[i].submitter.username): tmp.append(result[i].submitter.username) result = result.filter(submitter__username__in=tmp) Thanks in advance for other suggestions. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---