text
stringlengths 0
93.6k
|
---|
pets: list[Pet] = Field(title="Pets", description="Employee pets", default_factory=list)
|
jobs: list[str] = Field(
|
title="Past jobs", description="List of previous jobs the employee has held", default_factory=list
|
)
|
bob = Employee(
|
name="Bob",
|
age=30,
|
joined="2020-01-01",
|
mini_bio="### Birth\nSomething something\n\n### Education\nCollege",
|
office="au",
|
metadata={
|
"languages": ["fr", "en"],
|
"siblings": 2,
|
"location": {
|
"type": "home_office",
|
"has_workstation": True,
|
"workstation": {
|
"has_desk": True,
|
"has_monitor": False,
|
"desk": {"height": {"value": 125, "unit": "cm"}, "material": "wood", "color": "#89284a"},
|
},
|
},
|
},
|
pets=[{"name": "Rex", "species": "dog"}],
|
jobs=["Engineer", "Lawyer"],
|
# resume_file="gs://ecmwf-open-data/20240406/06z/ifs/0p4-beta/scda",
|
)
|
AIO_ID = "home"
|
FORM_ID = "Bob"
|
app.layout = dmc.MantineProvider(
|
id="mantine-provider",
|
defaultColorScheme="auto",
|
children=dmc.AppShell(
|
[
|
dmc.NotificationProvider(),
|
dmc.AppShellMain(
|
dmc.Container(
|
[
|
dmc.Group(
|
[
|
dmc.Title("Dash Pydantic form", order=3),
|
dmc.Switch(
|
offLabel=DashIconify(icon="radix-icons:moon", height=18),
|
onLabel=DashIconify(icon="radix-icons:sun", height=18),
|
size="md",
|
color="yellow",
|
persistence=True,
|
checked=True,
|
id="scheme-switch",
|
),
|
],
|
align="center",
|
justify="space-between",
|
mb="1rem",
|
),
|
ModelForm(
|
# Employee,
|
bob,
|
AIO_ID,
|
FORM_ID,
|
# read_only=True,
|
# submit_on_enter=True,
|
debounce=500,
|
# locale="fr",
|
store_progress="session",
|
restore_behavior="notify",
|
form_cols=12,
|
fields_repr={
|
"name": {"placeholder": "Enter your name"},
|
"metadata": {
|
"render_type": "accordion",
|
"visible": ("_root_:office", "==", "au"),
|
"excluded_fields": ["private_field"],
|
},
|
"pets": fields.Table(
|
fields_repr={
|
"species": {"options_labels": {"dog": "Dog", "cat": "Cat"}},
|
},
|
table_height=200,
|
dynamic_options={
|
"species": {"namespace": "pydf_usage", "function_name": "getSpecies"}
|
},
|
column_defs_overrides={
|
"species": {
|
"cellEditorParams": {
|
"catNames": ["Felix", "Cookie"],
|
"dogNames": ["Rex", "Brownie"],
|
}
|
}
|
},
|
grid_kwargs={"dashGridOptions": {"suppressCellFocus": False}},
|
excluded_fields=["alive"],
|
fields_order=["species"],
|
),
|
"jobs": {"placeholder": "A job name"},
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.