Listing tags attached to an organization, and basic model/view things around tag details

This commit is contained in:
Michael DeHaan
2013-03-23 16:03:17 -04:00
parent 2484f7eb4a
commit b68ab024ec
5 changed files with 59 additions and 10 deletions

View File

@@ -26,8 +26,12 @@ class BaseList(generics.ListCreateAPIView):
raise exceptions.NotImplementedError
def get_queryset(self):
if self.__class__.model == User:
return self._get_queryset().filter(is_active=True)
base = self._get_queryset()
model = self.__class__.model
if model == User:
return base.filter(is_active=True)
elif model in [ Tag, AuditTrail ]:
return base
else:
return self._get_queryset().filter(active=True)