Commits

Anonymous committed fdbcffe

Fixed aggregate imports

Comments (0)

Files changed (1)

gnocchi_forum/views.py

 from django.views.generic.simple import direct_to_template
 from django.views.generic.list_detail import object_list
 from django.shortcuts import get_object_or_404
+from django.db.models import Max, Count
 
 from gnocchi_forum import models
 
     # permssion check?
     return object_list(request,
         queryset = forum.thread_set.annotate(
-            most_recent_post=models.Max('post__created'),
-            post_count=models.Count('post')
+            most_recent_post=Max('post__created'),
+            post_count=Count('post')
         ).all(),
         template_name='forum/forum_detail.html',
         extra_context = {