1. Spencer Herzberg
  2. django-reporting

Commits

ppr.vitaly  committed 2eb2c4d

DisticntCount helper - works like Count but adds a distinct extra to query

git-svn-id: http://django-reporting.googlecode.com/svn/trunk@1104576334-096a-11de-9036-69e38a880166

  • Participants
  • Parent commits 8033815
  • Branches master

Comments (0)

Files changed (1)

File reporting/__init__.py

View file
         except ImportError:
             continue
         __import__('%s.%s' % (app, REPORTING_SOURCE_FILE))
+
+
+def DistinctCount(field):
+    from django.db.models import Count
+    return Count(field, distinct=True)