16 lines
600 B
Python
16 lines
600 B
Python
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),
|
|
admin.site.register(PlanCalendar)
|