summaryrefslogtreecommitdiff
path: root/models/base.py
blob: 8a6fc4743a1c327adab3a71d2dd5a9f9e8ad1d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""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