On Mon, Nov 9, 2015 at 10:46 AM, frocco <faro...@gmail.com> wrote: > Hello, > > request.user.groups.all() returns: > > [<Group: VNA>, <Group: St. E's>] > > > z = request.user.groups.all() > > I am trying to limit records based on: > > mytable.filter(company__in=z) > > > What am I doing wrong? > > >From the look of it, nothing. What happens when you do that? We'll need error tracebacks or an explanation of symptoms to diagnose further.
Is mytable.company a foreign key to django.contrib.auth.models.Group? If not, I can see why such a filter wouldn't work (or worse, would give inaccurate results). -James -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciX0pV3P2cJuAu8kW7AnyAX%3DdWstYfvTv2UuoPVFUo4qLQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.