[Django]-Check for changed field in a Django CBV Update

8👍

You can do that with:

if 'value' in form.changed_data:

where:

  • form is your AnnouncementForm and has been validated first (form.is_valid)
  • value is the field name

Since you’re using CBV, you can put the logic in form_valid method, to make sure all the data is properly validated (unless you have a different use case)

Leave a comment