Created
January 4, 2017 19:07
-
-
Save qpfiffer/53f744e2b32ad4d238ba577cbecfbfb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for field in changed_bar_fields_whitelist: | |
formatted_field_name = '_stashed_{}'.format(field) | |
try: | |
stashed_field = getattr(instance, formatted_field_name) | |
current_field = getattr(instance, field) | |
if current_field != stashed_field: | |
changed.append(field) | |
except AttributeError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment