61 lines
1.4 KiB
Python
61 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from core.apps.evaluation.models import RealEstateEvaluationModel
|
|
|
|
|
|
@admin.register(RealEstateEvaluationModel)
|
|
class RealEstateEvaluationAdmin(ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"valuation",
|
|
"property_type",
|
|
"address",
|
|
"total_area",
|
|
"floor",
|
|
"build_year",
|
|
"condition",
|
|
)
|
|
list_filter = (
|
|
"property_type",
|
|
"condition",
|
|
"has_renovation",
|
|
)
|
|
search_fields = (
|
|
"address",
|
|
"cadastral_number",
|
|
"valuation__conclusion_number",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
autocomplete_fields = ("valuation",)
|
|
fieldsets = (
|
|
("Ariza", {
|
|
"fields": ("valuation",),
|
|
}),
|
|
("Mulk ma'lumotlari", {
|
|
"fields": (
|
|
"property_type",
|
|
"address",
|
|
"cadastral_number",
|
|
),
|
|
}),
|
|
("Texnik parametrlar", {
|
|
"fields": (
|
|
("total_area", "living_area"),
|
|
("floor", "total_floors"),
|
|
"rooms_count",
|
|
"build_year",
|
|
),
|
|
}),
|
|
("Holat", {
|
|
"fields": (
|
|
"condition",
|
|
"has_renovation",
|
|
),
|
|
}),
|
|
("Tizim", {
|
|
"classes": ("collapse",),
|
|
"fields": ("created_at", "updated_at"),
|
|
}),
|
|
)
|