Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
94d20469f6
|
|
@ -1,8 +1,9 @@
|
|||
"""Location app views."""
|
||||
from rest_framework import generics
|
||||
from rest_framework import permissions
|
||||
|
||||
from django.db.models.expressions import RawSQL
|
||||
from location import models, serializers
|
||||
from utils.models import get_current_locale
|
||||
|
||||
|
||||
# Mixins
|
||||
|
|
@ -37,7 +38,9 @@ class CountryListView(CountryViewMixin, generics.ListAPIView):
|
|||
"""List view for model Country."""
|
||||
|
||||
pagination_class = None
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super().get_queryset().order_by(RawSQL("name->>%s", (get_current_locale(),)))
|
||||
return qs
|
||||
|
||||
class CountryRetrieveView(CountryViewMixin, generics.RetrieveAPIView):
|
||||
"""Retrieve view for model Country."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user