admin fayllari to'g'irlandi

This commit is contained in:
Husanjonazamov
2026-02-18 18:16:20 +05:00
parent 7b05f1f99e
commit cba724e2d0
12 changed files with 569 additions and 26 deletions

View File

@@ -8,5 +8,55 @@ from core.apps.evaluation.models import VehicleModel
class VehicleAdmin(ModelAdmin):
list_display = (
"id",
"__str__",
"brand",
"model",
"license_plate",
"manufacture_year",
"color",
"fuel_type",
"condition",
"mileage",
)
list_filter = (
"fuel_type",
"body_type",
"condition",
"manufacture_year",
)
search_fields = (
"brand",
"model",
"license_plate",
"vin_number",
"engine_number",
"tech_passport_number",
)
readonly_fields = ("created_at", "updated_at")
fieldsets = (
("Texnik passport", {
"fields": (
("tech_passport_series", "tech_passport_number"),
("tech_passport_issued_date", "tech_passport_issued_by"),
),
}),
("Transport ma'lumotlari", {
"fields": (
("brand", "model"),
"license_plate",
("manufacture_year", "color"),
("vin_number", "engine_number"),
"position",
),
}),
("Texnik holat", {
"fields": (
("fuel_type", "body_type"),
"condition",
"mileage",
),
}),
("Tizim", {
"classes": ("collapse",),
"fields": ("created_at", "updated_at"),
}),
)