mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-10 10:12:21 +01:00
Fixes on arrows in the main screen
This commit is contained in:
@ -53,8 +53,12 @@ class PlaylistSong(models.Model):
|
||||
self.switch_order(other_song)
|
||||
|
||||
def move_down(self):
|
||||
other_song = PlaylistSong.objects.filter(playlist=self.playlist, id__gt=self.id).order_by('id').first()
|
||||
self.switch_order(other_song)
|
||||
other_song = PlaylistSong.objects.filter(playlist=self.playlist, id__gt=self.id).first()
|
||||
old_id = self.id
|
||||
self.id = other_song.id
|
||||
other_song.id = old_id
|
||||
self.save()
|
||||
other_song.save()
|
||||
|
||||
def switch_order(self, other_song):
|
||||
old_id = self.id
|
||||
|
||||
Reference in New Issue
Block a user