1👍
If you just need to update a few fields in that model, this may be the best approach:
address = Address.objects.create(building_name=building_name, postcode=postcode)
address.street = "new street"
address.save()
0👍
If u are looking to update particular variable of a class –
address.Column_Name= Value
address.save()
You can return same address object with updated value.
- View with multiple forms not saving (missing 1 positional argument on form)
- Exposing View in Django-Python to delete items
- DJango won't find virtual env
- Django: query various objects in a loop
- Rewrite `example.com/foo/bar` to `foo.example.com/bar` with nginx. Redirect loop
Source:stackexchange.com