fix - some changes in pos randher/ web herd / web licestock/
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from django.db import transaction
|
||||
from rest_framework import status
|
||||
from rest_framework import status, filters
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.decorators import action
|
||||
from rest_framework.response import Response
|
||||
@@ -20,6 +20,20 @@ class HerdViewSet(BaseViewSet, SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
""" Herd ViewSet """
|
||||
queryset = Herd.objects.all()
|
||||
serializer_class = HerdSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
search_fields = [
|
||||
"rancher__ranching_farm",
|
||||
"name",
|
||||
"code",
|
||||
"province__name",
|
||||
"city__name",
|
||||
"postal",
|
||||
"institution",
|
||||
"epidemiologic",
|
||||
"contractor",
|
||||
"activity",
|
||||
"capacity",
|
||||
]
|
||||
|
||||
@transaction.atomic
|
||||
def create(self, request, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user