updated repr
This commit is contained in:
parent
7e10668cbc
commit
4b1536c19a
@ -23,10 +23,12 @@ class FormField:
|
||||
def __repr__(self) -> str:
|
||||
s = '<InputField' if self.options is None else '<SelectField'
|
||||
s += f': name="{self.name}"'
|
||||
if self.required:
|
||||
s += ', required=True'
|
||||
if self._default is not None:
|
||||
s += f', default="{self.default}"'
|
||||
if self.required:
|
||||
s += ', required=True'
|
||||
if self.options is not None:
|
||||
s += f', options={self.options}'
|
||||
return s + '>'
|
||||
|
||||
def __str__(self) -> str:
|
||||
@ -75,6 +77,10 @@ class Form:
|
||||
self.full_payload_always: bool = full_payload
|
||||
self.url: Optional[str] = url
|
||||
|
||||
def __repr__(self) -> str:
|
||||
fields = ', '.join(f"'{alias}': {field}" for alias, field in self.fields.items())
|
||||
return f'Form({fields})'
|
||||
|
||||
@property
|
||||
def fields(self) -> Dict[str, FormField]:
|
||||
return self._fields.copy()
|
||||
|
Loading…
Reference in New Issue
Block a user