Add initial implementations for forms and organization apps with serializers, factories, and admin configurations
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 5m5s
CI/CD Pipeline / Run Tests (push) Failing after 5m5s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 5m5s
CI/CD Pipeline / Run Tests (push) Failing after 5m5s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped
This commit is contained in:
39
src/apps/form_6/admin.py
Normal file
39
src/apps/form_6/admin.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""Админка формы Ф-6."""
|
||||
|
||||
from apps.form_6.models import FormF6Record
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
@admin.register(FormF6Record)
|
||||
class FormF6RecordAdmin(admin.ModelAdmin):
|
||||
"""Админка записей формы Ф-6."""
|
||||
|
||||
list_display = [
|
||||
"organization", "load_batch", "row_code", "category",
|
||||
"total_equipment", "physical_wear_percent", "created_at",
|
||||
]
|
||||
list_filter = ["load_batch", "created_at"]
|
||||
search_fields = ["organization__name", "organization__inn", "row_code", "category"]
|
||||
readonly_fields = ["id", "created_at", "updated_at"]
|
||||
raw_id_fields = ["organization"]
|
||||
ordering = ["-created_at"]
|
||||
|
||||
fieldsets = [
|
||||
("Основная информация", {"fields": ["id", "organization", "load_batch"]}),
|
||||
("Категоризация", {"fields": ["row_code", "category"]}),
|
||||
("Общие данные", {
|
||||
"fields": ["total_equipment", "domestic_equipment", "imported_equipment"],
|
||||
}),
|
||||
("Возрастная структура", {
|
||||
"fields": ["age_under_5", "age_5_10", "age_10_15", "age_15_20", "age_over_20"],
|
||||
}),
|
||||
("С ЧПУ по возрасту", {
|
||||
"fields": ["cnc_total", "cnc_under_5", "cnc_5_10", "cnc_10_15", "cnc_15_20", "cnc_over_20"],
|
||||
"classes": ["collapse"],
|
||||
}),
|
||||
("Показатели использования", {
|
||||
"fields": ["avg_shift_work", "utilization_rate", "physical_wear_percent"],
|
||||
}),
|
||||
("Потребности", {"fields": ["workplaces_without_equipment", "equipment_to_replace"]}),
|
||||
("Системные поля", {"fields": ["created_at", "updated_at"], "classes": ["collapse"]}),
|
||||
]
|
||||
Reference in New Issue
Block a user