delete move_up and switch_order functions

This commit is contained in:
oslomp
2018-12-18 19:21:05 +01:00
parent fb111f8be5
commit a000774e0b
3 changed files with 0 additions and 29 deletions

View File

@ -47,10 +47,6 @@ class PlaylistSong(models.Model):
)
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)\
.order_by('-id').first()
self.switch_order(other_song)
def move_down(self):
other_song = PlaylistSong.objects.filter(playlist=self.playlist, id__gt=self.id).first()
@ -60,13 +56,6 @@ class PlaylistSong(models.Model):
self.save()
other_song.save()
def switch_order(self, other_song):
old_id = self.id
self.id = other_song.id
other_song.id = old_id
self.save()
other_song.save()
def __str__(self):
return 'Playlist #' + str(self.playlist_id) + ': ' + str(self.song)