Unfavorite statuses

This commit is contained in:
Mouse Reeve
2020-03-21 15:21:27 -07:00
parent e0bd8200ad
commit 7455467c40
10 changed files with 143 additions and 19 deletions

View File

@ -65,6 +65,14 @@ class Favorite(FedireadsModel):
''' fav'ing a post '''
user = models.ForeignKey('User', on_delete=models.PROTECT)
status = models.ForeignKey('Status', on_delete=models.PROTECT)
remote_id = models.CharField(max_length=255, unique=True, null=True)
@property
def absolute_id(self):
''' constructs the absolute reference to any db object '''
if self.remote_id:
return self.remote_id
return super().absolute_id
class Meta:
unique_together = ('user', 'status')