Advertisement
Guest User

Untitled

a guest
Aug 12th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | None | 0 0
  1.     def get_comments_count(self):
  2.         ctype = ContentType.objects.get_for_model(self)
  3.         comments = Comment.objects.filter(content_type=ctype, object_id=self.id, is_deleted=0).count()
  4.         return comments
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement