Changeset 2775
- Timestamp:
- 04/28/06 20:08:24 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/contrib/comments/models.py
r2745 r2775 48 48 _karma_total_good and _karma_total_bad filled. 49 49 """ 50 kwargs.setdefault('select', {}) 51 kwargs['select']['_karma_total_good'] = 'SELECT COUNT(*) FROM comments_karmascore WHERE comments_karmascore.comment_id=comments.id AND score=1' 52 kwargs['select']['_karma_total_bad'] = 'SELECT COUNT(*) FROM comments_karmascore WHERE comments_karmascore.comment_id=comments.id AND score=-1' 53 return self.filter(**kwargs) 50 extra_kwargs = {} 51 extra_kwargs.setdefault('select', {}) 52 extra_kwargs['select']['_karma_total_good'] = 'SELECT COUNT(*) FROM comments_karmascore, comments_comment WHERE comments_karmascore.comment_id=comments_comment.id AND score=1' 53 extra_kwargs['select']['_karma_total_bad'] = 'SELECT COUNT(*) FROM comments_karmascore, comments_comment WHERE comments_karmascore.comment_id=comments_comment.id AND score=-1' 54 return self.filter(**kwargs).extra(**extra_kwargs) 54 55 55 56 def user_is_moderator(self, user): django/branches/magic-removal/django/contrib/comments/views/comments.py
r2722 r2775 109 109 # If the commentor has posted fewer than COMMENTS_FIRST_FEW comments, 110 110 # send the comment to the managers. 111 if self.user_cache. get_comments_comment_count() <= settings.COMMENTS_FIRST_FEW:111 if self.user_cache.comment_set.count() <= settings.COMMENTS_FIRST_FEW: 112 112 message = ngettext('This comment was posted by a user who has posted fewer than %(count)s comment:\n\n%(text)s', 113 113 'This comment was posted by a user who has posted fewer than %(count)s comments:\n\n%(text)s') % \
