Skip to content

Instantly share code, notes, and snippets.

Created October 24, 2013 05:33
What would you like to do?
# the following fields can only be updated when the is_disabled property is set to false
def clean_field_1(self):
if self.instance.is_disabled:
return self.instance.field_1
return self.cleaned_data.get('field_1')
def clean_field_2(self):
if self.instance.is_disabled:
return self.instance.field_2
return self.cleaned_data.get('field_2')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment