diff --git a/books/models.py b/books/models.py index 6b14800b..ea8bf92e 100644 --- a/books/models.py +++ b/books/models.py @@ -163,3 +163,7 @@ class BookTag(Tag): models.UniqueConstraint( fields=['content', 'mark'], name="unique_bookmark_tag") ] + + @property + def item(self): + return self.book diff --git a/games/models.py b/games/models.py index bb135c38..a47e8104 100644 --- a/games/models.py +++ b/games/models.py @@ -150,3 +150,7 @@ class GameTag(Tag): models.UniqueConstraint( fields=['content', 'mark'], name="unique_gamemark_tag") ] + + @property + def item(self): + return self.game diff --git a/movies/models.py b/movies/models.py index c12544a2..63a7523c 100644 --- a/movies/models.py +++ b/movies/models.py @@ -270,3 +270,7 @@ class MovieTag(Tag): models.UniqueConstraint( fields=['content', 'mark'], name="unique_moviemark_tag") ] + + @property + def item(self): + return self.movie diff --git a/music/models.py b/music/models.py index b75811c0..11a931ca 100644 --- a/music/models.py +++ b/music/models.py @@ -185,6 +185,10 @@ class SongTag(Tag): fields=['content', 'mark'], name="unique_songmark_tag") ] + @property + def item(self): + return self.song + class AlbumMark(Mark): album = models.ForeignKey( @@ -227,3 +231,7 @@ class AlbumTag(Tag): models.UniqueConstraint( fields=['content', 'mark'], name="unique_albummark_tag") ] + + @property + def item(self): + return self.album