Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync fork with upstream #219

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/python-fastui/fastui/json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,18 +185,21 @@ def json_schema_field_to_field(
initial=schema.get('default'),
description=schema.get('description'),
mode=schema.get('mode', 'checkbox'),
class_name=schema.get('className'),
)
elif field := special_string_field(schema, name, title, required, False):
return field
else:
return FormFieldInput(
name=name,
title=title,
placeholder=schema.get('placeholder'),
html_type=input_html_type(schema),
required=required,
initial=schema.get('default'),
autocomplete=schema.get('autocomplete'),
description=schema.get('description'),
class_name=schema.get('className'),
)


Expand Down Expand Up @@ -246,6 +249,7 @@ def special_string_field(
multiple=multiple,
accept=schema.get('accept'),
description=schema.get('description'),
class_name=schema.get('className'),
)
elif schema.get('format') == 'textarea':
return FormFieldTextarea(
Expand All @@ -258,6 +262,7 @@ def special_string_field(
initial=schema.get('initial'),
description=schema.get('description'),
autocomplete=schema.get('autocomplete'),
class_name=schema.get('className'),
)
elif enum := schema.get('enum'):
enum_labels = schema.get('enum_labels', {})
Expand All @@ -271,6 +276,7 @@ def special_string_field(
initial=schema.get('default'),
description=schema.get('description'),
autocomplete=schema.get('autocomplete'),
class_name=schema.get('className'),
)
elif search_url := schema.get('search_url'):
return FormFieldSelectSearch(
Expand All @@ -282,6 +288,7 @@ def special_string_field(
multiple=multiple,
initial=schema.get('initial'),
description=schema.get('description'),
class_name=schema.get('className'),
)


Expand Down
Loading