Last active
December 16, 2015 20:10
-
-
Save pauricthelodger/5490599 to your computer and use it in GitHub Desktop.
From https://github.com/pauricthelodger/spaceapi-server/blob/master/spaceapis.py If validate passes: 'sync' dictionary with dict.update
This file contains 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
def validate(self, current_data, new_data): | |
if isinstance(new_data, dict): | |
return self.validate_dict(current_data, new_data) | |
elif isinstance(new_data, list): | |
return self.validate_list(current_data, new_data) | |
else: | |
return True | |
def sync(self, current_data, new_data): | |
if isinstance(new_data, dict): | |
return self.sync_dict(current_data, new_data) | |
elif isinstance(new_data, list): | |
return self.sync_list(current_data, new_data) | |
else: | |
return True | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment