-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add icons for reactions and templatetags to show them
Add svg icons for like and dislike - fill them if the logged in user has liked or disliked a comment - add templatetags that make this feature possible Add post save signal to Comment model - Reaction instance is created when a new comment is created. Changes in ReactionInstance model - change related name for user attribute -> 'reactions' seems more natural.
- Loading branch information
1 parent
96e9f0a
commit 334dea9
Showing
6 changed files
with
84 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
"""Manager for Reaction Model""" | ||
from django.db import models | ||
|
||
|
||
class ReactionManager(models.Manager): | ||
""" | ||
Manager to optimize SQL queries for reactions. | ||
""" | ||
|
||
def get_queryset(self): | ||
return super().get_queryset().select_related('comment') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters