Esempio n. 1
0
 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()
Esempio n. 2
0
 def attrs(self):
     return AttributesDict(self.base_attrs).render()