Шаблон отпуск

This commit is contained in:
iriska-gri committed 2023-11-20 16:49:47 +03:00
1 parent 261602ec06
commit cc7b5316c0
7 files changed
+134 -25

No files matched your search

+6 -6
View File
@@ -1,13 +1,13 @@
from django.contrib import admin
from .models import *
# class GeneralVacationAdmin(admin.ModelAdmin):
# fields = ('login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
# list_display=('get_name', 'login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
# readonly_fields=('get_name',)
# def get_name(self, obj):
class GeneralVacationAdmin(admin.ModelAdmin):
fields = ('login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
list_display=('get_name', 'login', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
readonly_fields=('get_name',)
def get_name(self, obj):
# return obj.user.fio()
return obj.user.fio()
class PlanCalendarAdmin(admin.ModelAdmin):
list_display = ('name', 'start_work_period', 'end_work_period')