initial commit
This commit is contained in:
4
core/apps/contracts/admin/__init__.py
Normal file
4
core/apps/contracts/admin/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from .attached_files import * # noqa
|
||||
from .contracts import * # noqa
|
||||
from .file_contents import * # noqa
|
||||
from .owners import * # noqa
|
||||
24
core/apps/contracts/admin/attached_files.py
Normal file
24
core/apps/contracts/admin/attached_files.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # type: ignore
|
||||
|
||||
from core.apps.contracts.models import ContractAttachedFileModel
|
||||
|
||||
|
||||
@admin.register(ContractAttachedFileModel)
|
||||
class FileAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"name",
|
||||
"contract",
|
||||
"allowed_types",
|
||||
"created_at",
|
||||
)
|
||||
search_fields = (
|
||||
"name",
|
||||
"contract",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
list_display_links = (
|
||||
"name",
|
||||
)
|
||||
|
||||
26
core/apps/contracts/admin/contracts.py
Normal file
26
core/apps/contracts/admin/contracts.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # type: ignore
|
||||
|
||||
from core.apps.contracts.models import ContractModel
|
||||
|
||||
|
||||
@admin.register(ContractModel)
|
||||
class ContractAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"name",
|
||||
"identifier",
|
||||
"file_permissions",
|
||||
"created_at",
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"name",
|
||||
"identifier",
|
||||
"owners",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
|
||||
list_display_links = (
|
||||
"name",
|
||||
)
|
||||
26
core/apps/contracts/admin/file_contents.py
Normal file
26
core/apps/contracts/admin/file_contents.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # type: ignore
|
||||
|
||||
from core.apps.contracts.models import ContractFileContentModel
|
||||
|
||||
|
||||
@admin.register(ContractFileContentModel)
|
||||
class FilecontentAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"owner_name",
|
||||
"contract_owner",
|
||||
"file",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
search_fields = (
|
||||
"contract_owner"
|
||||
"file",
|
||||
"content",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"document_url",
|
||||
)
|
||||
list_display_links = (
|
||||
"owner_name",
|
||||
)
|
||||
78
core/apps/contracts/admin/owners.py
Normal file
78
core/apps/contracts/admin/owners.py
Normal file
@@ -0,0 +1,78 @@
|
||||
from django.contrib import admin
|
||||
from unfold.admin import ModelAdmin # type: ignore
|
||||
|
||||
from core.apps.contracts.models import (
|
||||
ContractOwnerModel,
|
||||
LegalEntityModel,
|
||||
IndividualModel,
|
||||
)
|
||||
|
||||
|
||||
@admin.register(IndividualModel)
|
||||
class IndividualAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"full_name",
|
||||
"individual_code",
|
||||
"phone",
|
||||
"use_face_id",
|
||||
"created_at",
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"full_name",
|
||||
"iin_code",
|
||||
"person_code",
|
||||
"phone",
|
||||
"use_face_id",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
|
||||
list_display_links = (
|
||||
"full_name",
|
||||
)
|
||||
|
||||
|
||||
@admin.register(LegalEntityModel)
|
||||
class LegalentityAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"name",
|
||||
"role",
|
||||
"entity_code",
|
||||
"phone",
|
||||
"created_at",
|
||||
)
|
||||
search_fields = (
|
||||
"name",
|
||||
"role",
|
||||
"bin_code",
|
||||
"identifier",
|
||||
"phone",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
)
|
||||
|
||||
list_display_links = (
|
||||
"name",
|
||||
)
|
||||
|
||||
|
||||
@admin.register(ContractOwnerModel)
|
||||
class OwnerAdmin(ModelAdmin):
|
||||
list_display = (
|
||||
"owner_identity",
|
||||
"owner_name",
|
||||
"status",
|
||||
"created_at"
|
||||
)
|
||||
|
||||
search_fields = (
|
||||
"owner_name",
|
||||
"status",
|
||||
"created_at",
|
||||
"updated_at"
|
||||
)
|
||||
|
||||
list_display_links = (
|
||||
"owner_identity",
|
||||
)
|
||||
Reference in New Issue
Block a user