On Jul 9, 5:17 am, queezy <[EMAIL PROTECTED]> wrote: > I would like to do this in Django, using two lists that are QuerySet lists: > > mylist=mylistWHOM.intersection(mylistWHAT) > > When I do it in the Pythonic way above, the django parser complains with: > 'QuerySet' object has no attribute 'intersection'
Of course it complains, QuerySets (or lists) don't have a function called intersection. You can't just make up a name and expect it to do what you want. mylistWHOM.invite_them_to_my_party() won't work either. try something like: whom = set(mylistWHOM) what = set(mylistWHAT) mylist = whom & what # or whom.intersection(what), same thing. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---