blob: 9ccec085d46cafdee7de74207f75c5ddedc10e16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
"""Implements a base model for other models to inherit."""
from six import iteritems
class BaseModel(object):
"""BaseModel is meant to be inherited by other models."""
def as_dict(self):
"""Exposes all the object's values as a dict."""
this_dict = {}
for key, val in iteritems(self.__dict__):
if key != "_db":
this_dict[key] = val
return this_dict
|