Skip to content

Instantly share code, notes, and snippets.

@dvl
Created April 27, 2017 01:40
Show Gist options
  • Save dvl/5dd704b36bbc6f27a699eaf3b80edd3c to your computer and use it in GitHub Desktop.
Save dvl/5dd704b36bbc6f27a699eaf3b80edd3c to your computer and use it in GitHub Desktop.
class FilterCurrentUserMixin(object):
def get_queryset(self):
queryset = super(FilterCurrentUserMixin, self).get_queryset()
queryset = queryset.filter(user=self.request.user)
return queryset
@tporto
Copy link

tporto commented Apr 27, 2017

Como faria para implementar, tentei colocando desta forma "class List(ListView, FilterCurrentUserMixin):" mas retorna um erro.

@tporto
Copy link

tporto commented Apr 27, 2017

Consegui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment