|
|
@ -10,6 +10,7 @@ from rest_framework.authtoken.models import Token |
|
|
from apps.account.models import User |
|
|
from apps.account.models import User |
|
|
from apps.api.models import Comment, AppVersion |
|
|
from apps.api.models import Comment, AppVersion |
|
|
from apps.api.serializers import CommentSerializer, AppVersionSerializer |
|
|
from apps.api.serializers import CommentSerializer, AppVersionSerializer |
|
|
|
|
|
from utils.pagination import StandardResultsSetPagination |
|
|
|
|
|
|
|
|
class HomeSerializer(serializers.Serializer): |
|
|
class HomeSerializer(serializers.Serializer): |
|
|
token = serializers.CharField() |
|
|
token = serializers.CharField() |
|
|
@ -65,6 +66,7 @@ class CommentListAPIView(ListAPIView): |
|
|
serializer_class = CommentSerializer |
|
|
serializer_class = CommentSerializer |
|
|
permission_classes = [AllowAny] |
|
|
permission_classes = [AllowAny] |
|
|
ordering = ['order', '-created_at'] # Order by order field first, then by newest |
|
|
ordering = ['order', '-created_at'] # Order by order field first, then by newest |
|
|
|
|
|
pagination_class = StandardResultsSetPagination |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description="List comments ordered by 'order' then '-created_at'", |
|
|
operation_description="List comments ordered by 'order' then '-created_at'", |
|
|
@ -87,6 +89,7 @@ class AppVersionListAPIView(ListAPIView): |
|
|
queryset = AppVersion.objects.all().order_by('-created_at') |
|
|
queryset = AppVersion.objects.all().order_by('-created_at') |
|
|
serializer_class = AppVersionSerializer |
|
|
serializer_class = AppVersionSerializer |
|
|
permission_classes = [AllowAny] |
|
|
permission_classes = [AllowAny] |
|
|
|
|
|
pagination_class = StandardResultsSetPagination |
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description="List all app versions with fields.", |
|
|
operation_description="List all app versions with fields.", |
|
|
responses={ |
|
|
responses={ |
|
|
|