1👍
I suggest using UpdateView, one of Django’s class-based-views for generic editing:
class django.views.generic.edit.UpdateView
A view that displays a
form for editing an existing object, redisplaying the form with
validation errors (if there are any) and saving changes to the object.
This uses a form automatically generated from the object’s model class
(unless a form class is manually specified).
0👍
I managed to get the answer, i imported the form to
import the user that i want to edit
u = User.objects.get(username = user_name)
creating the form with values from existing in database and updating with values from POST
user_form = UserEditForm(request.POST,instance=u)
save the form, since it already has existing record it will update
user_form.save()
- [Answer]-Stale content type prompt deleting all model instances after renaming django model with permissions
- [Answer]-Dynamic search with django form
- [Answer]-Can't install opentok via pip due to "CompressionError: bz2 module is not available"
Source:stackexchange.com