2👍
✅
Well, you could refactor it into a function.
def save_with_user(form, user):
obj = form.save(commit = False)
obj.user = user
obj.save()
# ...
form = EmploymentForm(data=request.POST or None, request=request)
save_with_user(form, profile)
- [Answered ]-Find outermost cordinates from Geodjango queryset which has point column
- [Answered ]-Output the values of the variables of django rest framework
Source:stackexchange.com