On Wed, Mar 5, 2014 at 2:05 PM, Paulo Poiati <
paulog...@gmail.com> wrote:
> Hello everyone,
>
> While developing standard web applications one thing I frequently do is
> updating just one field of a model instance and save it after that. The best
> way to do that today (if you want to avoid the update in all the fields) is
> with the code bellow.
>
>
product.name = 'Name changed again'
> product.save(update_fields=['name'])
>
>
> I want to propose a shortcut for this kind of operation. I came up with two
> solutions.
>
> Solution One
>
> product.save(update_fields={'name': 'Name changed again'})
>
>
> Solution Two (My preferred)
>
> product.update_fields(name='Name changed again')
>
>