Skip to content
All lessons

Tech Insights· docs.djangoproject.com

You can pass a update_fields param to the model save method. One interesting use for this is to avoid updating dates in time stamped models.

product.name = 'Name changed again'
product.save(update_fields=['name'])

#specifying-which-fields-to-save

Shared by

Read on docs.djangoproject.com
  • Django

Book a call

Lessons like this one
shape how we build.

Tell us what you’re building. In one call, we’ll show you how our team would approach it.

Tell us what you’re building, and we’ll show you how we’d approach it.

Still prefer the good old email? Contact us