Removed superfluous mptt requirement

This commit is contained in:
Eliot Berriot 2018-03-19 14:06:51 +01:00
parent 944135e752
commit 8821a1bb43
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 4 additions and 17 deletions

View file

@ -1,8 +1,6 @@
from django.db import models
from django.utils import timezone
from mptt.models import MPTTModel, TreeOneToOneField
from funkwhale_api.common import fields
@ -28,18 +26,10 @@ class PlaylistTrack(MPTTModel):
'music.Track',
related_name='playlist_tracks',
on_delete=models.CASCADE)
previous = TreeOneToOneField(
'self',
blank=True,
null=True,
related_name='next',
on_delete=models.CASCADE)
index = models.PositiveIntegerField(null=True)
playlist = models.ForeignKey(
Playlist, related_name='playlist_tracks', on_delete=models.CASCADE)
class MPTTMeta:
level_attr = 'position'
parent_attr = 'previous'
class Meta:
ordering = ('-playlist', 'position')
ordering = ('-playlist', 'index')
unique_together = ('playlist', 'index')