Permalink
Browse files

case selection fix deux

  • Loading branch information...
1 parent 935abca commit 3661173bcc38fc4549deb1a06876aaa4fe65d9e4 @camd camd committed Apr 8, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 moztrap/model/library/api.py
View
7 moztrap/model/library/api.py
@@ -1,4 +1,5 @@
-from django.db.models import Max, Count
+from django.db.models import Max
+from moztrap.model.mtmodel import NotDeletedCount
from tastypie import http, fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
@@ -342,15 +343,15 @@ class Meta:
# case versions.
queryset = Case.objects.all().annotate(
order=Max("suitecases__order"),
- version_count=Count("versions"),
+ version_count=NotDeletedCount("versions"),
).exclude(version_count=0).select_related(
"product",
).prefetch_related(
"versions__tags",
).order_by("order")
list_allowed_methods = ['get']
- fields = ["id", "versions", "created_by"]
+ fields = ["id", "versions", "created_by", "version_count"]
filtering = {
"product": ALL_WITH_RELATIONS,
"versions": ALL_WITH_RELATIONS,

0 comments on commit 3661173

Please sign in to comment.