Created
October 25, 2018 01:52
-
-
Save wheaties/70e73fcbd013ffa524bc5f068a76290a to your computer and use it in GitHub Desktop.
Partially Persistent Data
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
class Field: | |
def __get__(self, obj, obj_type=None): | |
if not obj: | |
return self | |
return getattr(obj.view(), self.__name__) | |
def __set__(self, obj, value): | |
obj.update(self.__name__=value) | |
def __set_name__(self, name): | |
self.__name__ = name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment