magnet-cl / django-project-template

A project template for Django in python 3
MIT License
14 stars 8 forks source link

change: call save method on BaseModel.update with a parameter to avoid it #69

Closed imunizaga closed 3 years ago

imunizaga commented 3 years ago

Django has a way to only save a couple of attibutes of the model (the update_fields paramter on save method).

This PR updates the BaseModel.update method to use save(update_fields=...) while allowing the use of the previous way to avoid calling the save method. This method is now useful to set and store an attribute in a single line.