coerce options and default values to strings

This commit is contained in:
Daniil Fajnberg 2022-01-01 17:21:09 +01:00
parent 6f6d2192da
commit fe3dad39b5

View File

@ -29,8 +29,10 @@ class FormField:
obj = getattr(obj, attr)
self._default = obj
else:
self._default = default
self.options: Optional[OptionsT] = options
self._default = str(default)
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
def __repr__(self) -> str: