Skip to content

Instantly share code, notes, and snippets.

@blaix
Created December 19, 2016 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blaix/f536054d429682a9bdcdc985aa919ee0 to your computer and use it in GitHub Desktop.
Save blaix/f536054d429682a9bdcdc985aa919ee0 to your computer and use it in GitHub Desktop.
class BaseModel:
fields = ()
def __init__(self, **data):
for key, val in data.items():
setattr(self, key, val)
class MyModel(BaseModel):
fields = ('field1', 'field2', 'field3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment