chore [P-0]: сhore
This commit is contained in:
1 parent
d13d02fadb
commit
2e48e08b83
389 files changed
+17779
-11492
No files matched your search
Regular → Executable
+23
-14
@@ -1,32 +1,41 @@
|
||||
from django.contrib import admin
|
||||
from .models import *
|
||||
from django.db.models import Q
|
||||
|
||||
from about_inspection.models import InspectionDirections
|
||||
|
||||
from .models import *
|
||||
|
||||
|
||||
# Register your models here.
|
||||
class DictEmployeeAdmin(admin.ModelAdmin):
|
||||
# A handy constant for the name of the alternate database.
|
||||
# using = "user_directory"
|
||||
list_display=('fio', 'login', 'birthdate')
|
||||
search_fields = ('login', 'fio',)
|
||||
list_editable=('birthdate',)
|
||||
list_display = ("fio", "login", "birthdate")
|
||||
search_fields = (
|
||||
"login",
|
||||
"fio",
|
||||
)
|
||||
list_editable = ("birthdate",)
|
||||
|
||||
|
||||
class DepartmentDirections(admin.TabularInline):
|
||||
model =InspectionDirections
|
||||
fields = ( 'direction_title',)
|
||||
verbose_name="Направление деятельности отдела"
|
||||
verbose_name_plural= "Направления деятельности отдела"
|
||||
model = InspectionDirections
|
||||
fields = ("direction_title",)
|
||||
verbose_name = "Направление деятельности отдела"
|
||||
verbose_name_plural = "Направления деятельности отдела"
|
||||
can_delete = True
|
||||
# show_change_link = False
|
||||
extra = 0
|
||||
|
||||
|
||||
|
||||
class DictDepartmentAdmin(admin.ModelAdmin):
|
||||
readonly_fields=( 'name', 'name_from_ad')
|
||||
readonly_fields = ("name", "name_from_ad")
|
||||
inlines = [DepartmentDirections]
|
||||
def get_queryset(self, request):
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super().get_queryset(request)
|
||||
qs = qs.filter(deleted=0)
|
||||
return qs
|
||||
|
||||
admin.site.register(DictEmployee,DictEmployeeAdmin)
|
||||
admin.site.register(DictDepartment, DictDepartmentAdmin )
|
||||
|
||||
admin.site.register(DictEmployee, DictEmployeeAdmin)
|
||||
admin.site.register(DictDepartment, DictDepartmentAdmin)
|
||||
Reference in new issue
Block a user