Added posts creation and posts detail
This commit is contained in:
1 parent
12bda5d3da
commit
4946122f2e
12 files changed
+180
No files matched your search
@@ -51,6 +51,14 @@ class Profile(models.Model):
|
||||
def check_for_friendship(self, user):
|
||||
return self.friends.filter(pk=user.pk).exists()
|
||||
|
||||
def like_post(self, post):
|
||||
self.disliked_posts.remove(post)
|
||||
return self.liked_posts.add(post)
|
||||
|
||||
def dislike_post(self, post):
|
||||
self.liked_posts.remove(post)
|
||||
return self.disliked_posts.add(post)
|
||||
|
||||
@classmethod
|
||||
def check_unique(cls, user_id, validated_data):
|
||||
errors = {}
|
||||
|
||||
Reference in new issue
Block a user