feat: auto-evaluation update api serializer class changed
This commit is contained in:
@@ -16,7 +16,8 @@ from core.apps.evaluation.serializers.auto import (
|
||||
CreateAutoevaluationSerializer,
|
||||
ListAutoevaluationSerializer,
|
||||
RetrieveAutoevaluationSerializer,
|
||||
AutoEvaluationAppraisersSerializer
|
||||
AutoEvaluationAppraisersSerializer,
|
||||
UpdateAutoevaluationSerializer
|
||||
)
|
||||
|
||||
|
||||
@@ -28,7 +29,7 @@ class AutoEvaluationView(BaseViewSetMixin, ModelViewSet):
|
||||
"vehicle",
|
||||
).all()
|
||||
serializer_class = ListAutoevaluationSerializer
|
||||
permission_classes = [AllowAny]
|
||||
permission_classes = [IsAuthenticated]
|
||||
|
||||
filter_backends = [DjangoFilterBackend, SearchFilter, OrderingFilter]
|
||||
filterset_class = AutoevaluationFilter
|
||||
@@ -72,6 +73,8 @@ class AutoEvaluationView(BaseViewSetMixin, ModelViewSet):
|
||||
"list": ListAutoevaluationSerializer,
|
||||
"retrieve": RetrieveAutoevaluationSerializer,
|
||||
"create": CreateAutoevaluationSerializer,
|
||||
"update": UpdateAutoevaluationSerializer,
|
||||
"partial_update": UpdateAutoevaluationSerializer,
|
||||
}
|
||||
|
||||
|
||||
@@ -136,8 +139,8 @@ class AutoEvaluationListAppraisersView(GenericAPIView):
|
||||
query = auto_evaluation.appraisers.all()
|
||||
if search_query:
|
||||
query = query.filter(
|
||||
Q(phone__icontains=search_query) |
|
||||
Q(first_name__icontains=search_query) |
|
||||
Q(phone__icontains=search_query) |
|
||||
Q(first_name__icontains=search_query) |
|
||||
Q(last_name__icontains=search_query)
|
||||
)
|
||||
page = self.paginate_queryset(query)
|
||||
|
||||
@@ -71,11 +71,28 @@ class AdminEvaluationrequestView(BaseViewSetMixin, ModelViewSet):
|
||||
"tex_passport",
|
||||
]
|
||||
ordering_fields = [
|
||||
"id",
|
||||
"rate_type",
|
||||
"rate_type_display",
|
||||
"object_type",
|
||||
"object_type_display",
|
||||
"customer_inn_number",
|
||||
"owner_inn_number",
|
||||
"tex_passport",
|
||||
"value_determined",
|
||||
"rate_goal",
|
||||
"property_rights",
|
||||
"form_ownership",
|
||||
"worked_hours",
|
||||
"chassi",
|
||||
"need_delivering",
|
||||
"location",
|
||||
"location_name",
|
||||
"status",
|
||||
"status_display",
|
||||
"user",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"rate_type",
|
||||
"object_type",
|
||||
"status",
|
||||
]
|
||||
ordering = ["-created_at"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user