Add choices on Song.state

This commit is contained in:
Daan Sprenkels
2018-11-23 16:26:21 +01:00
parent ecd5537eaf
commit 84bf2653c2
2 changed files with 25 additions and 1 deletions

View File

@ -36,7 +36,13 @@ class PlaylistSong(models.Model):
# 1: Playing.
# 2: Played.
# 3: Cancelled.
state = models.IntegerField(default=0, db_index=True)
STATECHOICE = (
(0, 'Queued'),
(1, 'Playing'),
(2, 'Played'),
(3, 'Cancelled'),
)
state = models.IntegerField(default=0, db_index=True, choices=STATECHOICE)
def move_up(self):
other_song = PlaylistSong.objects.filter(playlist=self.playlist, id__lt=self.id)\