Lint
This commit is contained in:
parent
41305d18cd
commit
52649a0beb
@ -14,6 +14,6 @@ Including another URLconf
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.urls import include, path
|
||||
|
||||
urlpatterns = [path("admin/", admin.site.urls), path("", include("cars.urls"))]
|
||||
|
@ -1,4 +1,5 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Car
|
||||
|
||||
admin.site.register(Car)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import numpy as np
|
||||
import skfuzzy as fuzz
|
||||
from skfuzzy import control as ctrl
|
||||
from django.conf import settings
|
||||
from skfuzzy import control as ctrl
|
||||
|
||||
|
||||
def get_fuzzy_response(request_params, objects_list):
|
||||
@ -79,5 +79,5 @@ def get_fuzzy_response(request_params, objects_list):
|
||||
)
|
||||
if comparator and min(comparator) > settings.COMPARATOR:
|
||||
end_object_list.append(car)
|
||||
|
||||
|
||||
return end_object_list
|
||||
|
@ -1,4 +1,5 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from .models import Car
|
||||
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
from django.urls import path, include
|
||||
from django.urls import include, path
|
||||
|
||||
from .views import CarList, SettingsAPIView
|
||||
|
||||
# The API URLs are now determined automatically by the router.
|
||||
|
@ -1,7 +1,8 @@
|
||||
from rest_framework import generics
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
from django.conf import settings
|
||||
from rest_framework import generics
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
|
||||
from .fuzzy_logic import get_fuzzy_response
|
||||
from .models import Car
|
||||
from .serializers import CarSerializer
|
||||
@ -25,11 +26,12 @@ class SettingsAPIView(APIView):
|
||||
return Response("Settings changed")
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
return Response({
|
||||
'production_year':settings.PRODUCTION_YEAR,
|
||||
'mileage':settings.MILEAGE,
|
||||
'engine_capacity':settings.ENGINE_CAPACITY,
|
||||
'combustion':settings.COMBUSTION,
|
||||
'comparator':settings.COMPARATOR,
|
||||
|
||||
})
|
||||
return Response(
|
||||
{
|
||||
"production_year": settings.PRODUCTION_YEAR,
|
||||
"mileage": settings.MILEAGE,
|
||||
"engine_capacity": settings.ENGINE_CAPACITY,
|
||||
"combustion": settings.COMBUSTION,
|
||||
"comparator": settings.COMPARATOR,
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user