63 lines
1.5 KiB
Python
63 lines
1.5 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from core.apps.evaluation.models import QuickEvaluationModel
|
|
|
|
|
|
@admin.register(QuickEvaluationModel)
|
|
class QuickEvaluationAdmin(ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"created_by",
|
|
"brand",
|
|
"model",
|
|
"license_plate",
|
|
"manufacture_year",
|
|
"condition",
|
|
"estimated_price",
|
|
"created_at",
|
|
)
|
|
list_filter = (
|
|
"fuel_type",
|
|
"body_type",
|
|
"condition",
|
|
)
|
|
search_fields = (
|
|
"brand",
|
|
"model",
|
|
"license_plate",
|
|
"vin_number",
|
|
"engine_number",
|
|
"tech_passport_number",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
autocomplete_fields = ("created_by",)
|
|
fieldsets = (
|
|
("Foydalanuvchi", {
|
|
"fields": ("created_by",),
|
|
}),
|
|
("Transport ma'lumotlari", {
|
|
"fields": (
|
|
"tech_passport_number",
|
|
"license_plate",
|
|
("brand", "model"),
|
|
("manufacture_year", "color"),
|
|
("vin_number", "engine_number"),
|
|
"mileage",
|
|
),
|
|
}),
|
|
("Texnik holat", {
|
|
"fields": (
|
|
("fuel_type", "body_type"),
|
|
"condition",
|
|
),
|
|
}),
|
|
("Natija", {
|
|
"fields": ("estimated_price",),
|
|
}),
|
|
("Tizim", {
|
|
"classes": ("collapse",),
|
|
"fields": ("created_at", "updated_at"),
|
|
}),
|
|
)
|