from rest_framework import permissions
from rest_framework.filters import SearchFilter, OrderingFilter
from rest_framework.generics import ListAPIView

from .models import CompanyProfilePage, Links
from .serializers import CompanyProfilePageSerializer, LinksSerializer


class CompanyProfilePageViewSet(ListAPIView):
    permission_classes = [
        permissions.AllowAny
    ]
    queryset = CompanyProfilePage.objects.all()
    serializer_class = CompanyProfilePageSerializer

    filter_backends = (SearchFilter, OrderingFilter)
    search_fields = ('country', 'companyName', 'companyDescription', 'owner__first_name', "sections", 'type')


class LinksViewSet(ListAPIView):
    permission_classes = [
        permissions.AllowAny
    ]
    queryset = Links.objects.all()
    serializer_class = LinksSerializer

    filter_backends = (SearchFilter, OrderingFilter)
    search_fields = ('find', 'id')

6336dd5df6047e2278cc38904f97ec39311a2c18
<mask token>

<mask token>


class CompanyProfilePageViewSet(ListAPIView):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


class LinksViewSet(ListAPIView):
    permission_classes = [permissions.AllowAny]
    queryset = Links.objects.all()
    serializer_class = LinksSerializer
    filter_backends = SearchFilter, OrderingFilter
    search_fields = 'find', 'id'

<mask token>


class CompanyProfilePageViewSet(ListAPIView):
    permission_classes = [permissions.AllowAny]
    queryset = CompanyProfilePage.objects.all()
    serializer_class = CompanyProfilePageSerializer
    filter_backends = SearchFilter, OrderingFilter
    search_fields = ('country', 'companyName', 'companyDescription',
        'owner__first_name', 'sections', 'type')


class LinksViewSet(ListAPIView):
    permission_classes = [permissions.AllowAny]
    queryset = Links.objects.all()
    serializer_class = LinksSerializer
    filter_backends = SearchFilter, OrderingFilter
    search_fields = 'find', 'id'

from rest_framework import permissions
from rest_framework.filters import SearchFilter, OrderingFilter
from rest_framework.generics import ListAPIView
from .models import CompanyProfilePage, Links
from .serializers import CompanyProfilePageSerializer, LinksSerializer


class CompanyProfilePageViewSet(ListAPIView):
    permission_classes = [permissions.AllowAny]
    queryset = CompanyProfilePage.objects.all()
    serializer_class = CompanyProfilePageSerializer
    filter_backends = SearchFilter, OrderingFilter
    search_fields = ('country', 'companyName', 'companyDescription',
        'owner__first_name', 'sections', 'type')


class LinksViewSet(ListAPIView):
    permission_classes = [permissions.AllowAny]
    queryset = Links.objects.all()
    serializer_class = LinksSerializer
    filter_backends = SearchFilter, OrderingFilter
    search_fields = 'find', 'id'

from rest_framework import permissions
from rest_framework.filters import SearchFilter, OrderingFilter
from rest_framework.generics import ListAPIView

from .models import CompanyProfilePage, Links
from .serializers import CompanyProfilePageSerializer, LinksSerializer


class CompanyProfilePageViewSet(ListAPIView):
    permission_classes = [
        permissions.AllowAny
    ]
    queryset = CompanyProfilePage.objects.all()
    serializer_class = CompanyProfilePageSerializer

    filter_backends = (SearchFilter, OrderingFilter)
    search_fields = ('country', 'companyName', 'companyDescription', 'owner__first_name', "sections", 'type')


class LinksViewSet(ListAPIView):
    permission_classes = [
        permissions.AllowAny
    ]
    queryset = Links.objects.all()
    serializer_class = LinksSerializer

    filter_backends = (SearchFilter, OrderingFilter)
    search_fields = ('find', 'id')
