Skip to content

Instantly share code, notes, and snippets.

@jangjichang
Last active April 13, 2022 05:13
Show Gist options
  • Select an option

  • Save jangjichang/554c7f4f7e2f4d1d8a29c8d26229cd6b to your computer and use it in GitHub Desktop.

Select an option

Save jangjichang/554c7f4f7e2f4d1d8a29c8d26229cd6b to your computer and use it in GitHub Desktop.
@property
def validated_data(self):
if not hasattr(self, '_validated_data'):
msg = 'You must call `.is_valid()` before accessing `.validated_data`.'
raise AssertionError(msg)
return self._validated_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment