mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 04:09:25 +02:00
More filters / ordering option on playlist API
This commit is contained in:
parent
f503466a24
commit
bf6fe44bed
2 changed files with 11 additions and 2 deletions
|
@ -8,15 +8,14 @@ from rest_framework.decorators import detail_route
|
|||
from rest_framework.response import Response
|
||||
from rest_framework.permissions import IsAuthenticatedOrReadOnly
|
||||
|
||||
from funkwhale_api.music.models import Track
|
||||
from funkwhale_api.common import permissions
|
||||
from funkwhale_api.common import fields
|
||||
from funkwhale_api.music.models import Track
|
||||
|
||||
from . import filters
|
||||
from . import models
|
||||
from . import serializers
|
||||
|
||||
|
||||
class PlaylistViewSet(
|
||||
mixins.RetrieveModelMixin,
|
||||
mixins.CreateModelMixin,
|
||||
|
@ -37,6 +36,7 @@ class PlaylistViewSet(
|
|||
]
|
||||
owner_checks = ['write']
|
||||
filter_class = filters.PlaylistFilter
|
||||
ordering_fields = ('id', 'name', 'creation_date', 'modification_date')
|
||||
|
||||
def get_serializer_class(self):
|
||||
if self.request.method in ['PUT', 'PATCH', 'DELETE', 'POST']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue