coerce options and default values to strings
This commit is contained in:
parent
6f6d2192da
commit
fe3dad39b5
@ -29,8 +29,10 @@ class FormField:
|
|||||||
obj = getattr(obj, attr)
|
obj = getattr(obj, attr)
|
||||||
self._default = obj
|
self._default = obj
|
||||||
else:
|
else:
|
||||||
self._default = default
|
self._default = str(default)
|
||||||
self.options: Optional[OptionsT] = options
|
self.options: Optional[OptionsT] = None
|
||||||
|
if options is not None:
|
||||||
|
self.options = {str(k): str(v) for k, v in options.items()}
|
||||||
self.required: bool = required
|
self.required: bool = required
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user