1
This commit is contained in:
1 parent
d1db19fc58
commit
314ed6b7fb
3 files changed
+14
-2
No files matched your search
BIN
Binary file not shown.
@@ -21,6 +21,13 @@
|
||||
</v-row>
|
||||
|
||||
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-date-picker
|
||||
v-model="date1"
|
||||
:events="arrayEvents"
|
||||
event-color="green lighten-1"
|
||||
></v-date-picker>
|
||||
</v-col>
|
||||
<!-- <v-col>
|
||||
<v-btn
|
||||
|
||||
@@ -2,11 +2,16 @@ 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')
|
||||
fields = ('get_name','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()
|
||||
|
||||
# def formfield_for_foreignkey(self, db_field, request, **kwargs):
|
||||
# if db_field.name == 'user':
|
||||
# kwargs["queryset"] = DictEmployee.objects.using('user_directory').get(login=self.username).fio
|
||||
# return super().formfield_for_foreignkey(db_field, request,)
|
||||
|
||||
admin.site.register(GeneralVacation, GeneralVacationAdmin)
|
||||
Reference in new issue
Block a user