Skip to content

Commit

Permalink
feat(Comment articles and replies): Implement Commenting on Articles
Browse files Browse the repository at this point in the history
- Implementing comments on articles.
- Implementing replies on comments.

[Finishes  #159952008]
  • Loading branch information
huxaiphaer committed Sep 24, 2018
1 parent 96a6d94 commit d2a4e54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion authors/apps/articles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class to declare an article
from authors.apps.articles.utils import generate_slug
from authors.apps.authentication.models import User


class Tag(models.Model):
"""
Tag for the article(s). Every tag has unique tag_name.
Expand All @@ -20,7 +21,7 @@ class Tag(models.Model):
def __str__(self):
return self.tag_name

# noinspection SpellCheckingInspection

class Article(models.Model):
"""
A model for an article
Expand Down
3 changes: 1 addition & 2 deletions authors/apps/articles/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class ArticleSerializer(serializers.ModelSerializer):
"""
Define action logic for an article
"""

user_rating = serializers.CharField(
source='author.average_rating', required=False)
tagList = TagRelatedField(
Expand Down Expand Up @@ -143,7 +142,7 @@ class behaviours
model = Article

fields = ('slug', 'title', 'description', 'body', 'created_at', 'average_rating', 'user_rating',
'updated_at', 'favorited', 'favorites_count', 'photo_url', 'author', 'tagList', 'comments')
'updated_at', 'favorites_count', 'photo_url', 'author', 'tagList', 'comments')

def get_favorites_count(self, instance):
return instance.favorited_by.count()
Expand Down

0 comments on commit d2a4e54

Please sign in to comment.