def get_meta(self, context={}): vals = { "name": self.name, "string": _(self.string), "required": self.required, "on_change": self.on_change, "readonly": self.readonly, } return vals
def get_meta(self, context={}): vals = super(Selection, self).get_meta(context=context) vals["type"] = "selection" if isinstance(self.selection, str): m = netforce.model.get_model(self.model) f = getattr(m, self.selection) sel = f(context=context) else: sel = self.selection vals["selection"] = [(k, _(v)) for k, v in sel] return vals
def _translate(this, val): return _(val)