This commit is contained in:
iriska-gri committed 2023-09-19 16:39:08 +03:00
1 parent 9f350cbbe1
commit d1db19fc58
10 files changed
+55 -1

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
from django.contrib import admin
from .models import *
class GeneralVacationAdmin(admin.ModelAdmin):
fields = ('user', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
list_display=('get_name', 'user', 'planned_date', 'count_days', 'type_of_vacation', 'start_work_period', 'end_work_period')
readonly_fields=('get_name',)
def get_name(self, obj):
print(obj.user.fio(), '----------------obj.user.fio()')
return obj.user.fio()
admin.site.register(GeneralVacation, GeneralVacationAdmin)