Parses a dictionary of (model_attr, json_attr) items

def parse_map(self, obj, mapping=None, *args, **kwargs):
        """ Parses a dictionary of (model_attr, json_attr) items """
        mapping = mapping or obj._mapping

        if "data" in kwargs:
            for k, v in mapping.items():
                if kwargs["data"].get(v, None) is not None:
                    val = kwargs["data"][v]
                else:
                    val = None
                self.add_attr(obj, k, val, from_json=True)
        else:
            for k, v in mapping.items():
                if k in kwargs:
                    self.add_attr(obj, k, kwargs[k])