Skip to content

Instantly share code, notes, and snippets.

@Alir3z4
Created June 14, 2012 13:29
Show Gist options
  • Save Alir3z4/2930287 to your computer and use it in GitHub Desktop.
Save Alir3z4/2930287 to your computer and use it in GitHub Desktop.
def queryset(self, request):
if request.user.is_superuser:
return self.model.objects.all()
return self.model.objects.filter(user=request.user)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment