feat: add new document and documentcategory model for auto evaluation detail
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from .auto import * # noqa
|
||||
from .customer import * # noqa
|
||||
from .document import * # noqa
|
||||
from .documentcategory import * # noqa
|
||||
from .history import * # noqa
|
||||
from .movable import * # noqa
|
||||
from .quick import * # noqa
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
|
||||
from core.apps.evaluation.models import ValuationDocumentModel
|
||||
from core.apps.evaluation.models import DocumentModel, ValuationDocumentModel
|
||||
|
||||
|
||||
@admin.register(ValuationDocumentModel)
|
||||
@@ -23,20 +23,37 @@ class ValuationDocumentAdmin(ModelAdmin):
|
||||
readonly_fields = ("created_at", "updated_at")
|
||||
autocomplete_fields = ("valuation", "uploaded_by")
|
||||
fieldsets = (
|
||||
("Hujjat", {
|
||||
"fields": (
|
||||
"valuation",
|
||||
"document_type",
|
||||
"title",
|
||||
"file",
|
||||
"uploaded_by",
|
||||
),
|
||||
}),
|
||||
("Qo'shimcha", {
|
||||
"fields": ("description",),
|
||||
}),
|
||||
("Tizim", {
|
||||
"classes": ("collapse",),
|
||||
"fields": ("created_at", "updated_at"),
|
||||
}),
|
||||
(
|
||||
"Hujjat",
|
||||
{
|
||||
"fields": (
|
||||
"valuation",
|
||||
"document_type",
|
||||
"title",
|
||||
"file",
|
||||
"uploaded_by",
|
||||
),
|
||||
},
|
||||
),
|
||||
(
|
||||
"Qo'shimcha",
|
||||
{
|
||||
"fields": ("description",),
|
||||
},
|
||||
),
|
||||
(
|
||||
"Tizim",
|
||||
{
|
||||
"classes": ("collapse",),
|
||||
"fields": ("created_at", "updated_at"),
|
||||
},
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@admin.register(DocumentModel)
|
||||
class DocumentAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"id",
|
||||
"__str__",
|
||||
)
|
||||
|
||||
57
core/apps/evaluation/admin/documentcategory.py
Normal file
57
core/apps/evaluation/admin/documentcategory.py
Normal file
@@ -0,0 +1,57 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin
|
||||
|
||||
from core.apps.evaluation.models import DocumentcategoryModel
|
||||
|
||||
|
||||
@admin.register(DocumentcategoryModel)
|
||||
class DocumentcategoryAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"id",
|
||||
"label",
|
||||
"value",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
)
|
||||
search_fields = (
|
||||
"label",
|
||||
"value",
|
||||
)
|
||||
list_filter = (
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
readonly_fields = (
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
fieldsets = (
|
||||
(
|
||||
("Uzbekcha"),
|
||||
{
|
||||
"fields": (
|
||||
"label_uz",
|
||||
"value_uz",
|
||||
)
|
||||
}
|
||||
),
|
||||
(
|
||||
("Ruscha"),
|
||||
{
|
||||
"fields": (
|
||||
"label_ru",
|
||||
"value_ru",
|
||||
)
|
||||
}
|
||||
),
|
||||
(
|
||||
("Inglizcha"),
|
||||
{
|
||||
"fields": (
|
||||
"label_en",
|
||||
"value_en",
|
||||
)
|
||||
}
|
||||
),
|
||||
)
|
||||
list_display_links =list_display
|
||||
Reference in New Issue
Block a user