51 lines
1.2 KiB
Python
51 lines
1.2 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from core.apps.evaluation.models import EvaluationReportModel
|
|
|
|
|
|
@admin.register(EvaluationReportModel)
|
|
class EvaluationReportAdmin(ModelAdmin):
|
|
list_display = (
|
|
"id",
|
|
"report_number",
|
|
"valuation",
|
|
"evaluator",
|
|
"final_value",
|
|
"approved_at",
|
|
"created_at",
|
|
)
|
|
list_filter = ("approved_at",)
|
|
search_fields = (
|
|
"report_number",
|
|
"valuation__conclusion_number",
|
|
"evaluator__phone",
|
|
"evaluator__first_name",
|
|
"conclusion_text",
|
|
)
|
|
readonly_fields = ("created_at", "updated_at")
|
|
autocomplete_fields = ("valuation", "evaluator")
|
|
fieldsets = (
|
|
("Hisobot", {
|
|
"fields": (
|
|
"report_number",
|
|
"valuation",
|
|
"evaluator",
|
|
),
|
|
}),
|
|
("Natija", {
|
|
"fields": (
|
|
"final_value",
|
|
"conclusion_text",
|
|
"report_file",
|
|
),
|
|
}),
|
|
("Tasdiqlash", {
|
|
"fields": ("approved_at",),
|
|
}),
|
|
("Tizim", {
|
|
"classes": ("collapse",),
|
|
"fields": ("created_at", "updated_at"),
|
|
}),
|
|
)
|