1👍
Please see below code of admin.py
from .forms import tbmstappraisalschedForm
class AppraisalScheduleAdmin(admin.ModelAdmin):
exclude = ['intUpdatedBy']
# form = 'tbmstappraisalschedForm' you can not pass a string here .
form = tbmstappraisalschedForm #do like this
def save_model(self, request, obj, form, change):
obj.intUpdatedBy = request.user.id
obj.save()
Source:stackexchange.com