Created
September 15, 2020 18:53
-
-
Save tamert/d801dfd5d5daf4b4d038cc0ce452a177 to your computer and use it in GitHub Desktop.
views.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .models import Company | |
from .serializers import CompanySerializer | |
from rest_framework.generics import ListAPIView | |
class CompaniesView(ListAPIView): | |
queryset = Company.objects.all() | |
serializer_class = CompanySerializer | |
search_fields = ['name'] | |
ordering_fields = ['id', 'name', 'created_at'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment