Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class EmployeeAdmin(admin.ModelAdmin):
- form = EmployeeAdminForm
- def save_model(self, request, employee, form, change):
- username=form.cleaned_data['username']
- password=form.cleaned_data['password']
- first_name=form.cleaned_data['first_name']
- last_name=form.cleaned_data['last_name']
- email=form.cleaned_data['email']
- user = User(username=username, password=password, first_name=first_name,
- last_name=last_name, email=email)
- user.save()
- employee.user = user
- employee.save()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement