def to_json(self, context): return { "text": compact({ "type": self.field_type, "placeholder": force_text(self.placeholder) if self.placeholder else None, }) }
def to_json(self, context): return { "range": compact({ "min": maybe_call(self.min, context=context), "max": maybe_call(self.max, context=context), "step": maybe_call(self.step, context=context), "type": self.field_type, }) }