def attrs(self): attrs = {} for attr_name, attr in self.base_attrs.items(): if callable(attr): attrs[attr_name] = attr(self.obj, self.field) elif isinstance(attr, Accessor): attrs[attr_name] = attr.resolve(self.obj) else: attrs[attr_name] = attr return AttributesDict(attrs).render()
def attrs(self): return AttributesDict(self.base_attrs).render()