1👍
The car
can be passed to the ModelForm
instance as the instance
keyword argument, ie.
AddCar(instance=car)
To detect changes, you could use the is_valid()
method of the AddCar
instance combined with cleaned_data
dictionary. You would have to fetch the car
object as already you are, instantiate the AddCar
form with request.POST
values, and then compare values between the car
you’ve fetched and AddCar.cleaned_data
.
- [Answered ]-Deploying Django app to AWS EC2 using Nginx and Gunicorn
- [Answered ]-Django: ValueError: too many values to unpack on User model
- [Answered ]-While loop incrementing range in django
Source:stackexchange.com