viewflow.forms.
Layout
(*elements, **kwargs)¶Customizable form layout that supports the dynamic arrangement of form fields.
This class provides an interface for arranging form elements in a structured manner.
Example:
layout = Layout(
"username",
Row("password", "confirm_password"),
)
viewflow.forms.
Row
(*elements, **kwargs)¶Represents a row in the layout, where elements are aligned in a single line horizontally.
This class is used to horizontally arrange form elements or layout components. Each element in a row is rendered side by side, taking into account the various device-specific grid settings such as desktop, tablet, and mobile.
Example:
layout = Layout(
Row(
'first_name',
Row('last_name', 'sex', tablet=5)
)
)
viewflow.forms.
Column
(*elements, **kwargs)¶Represents a column in the layout, where elements are vertically stacked.
This class provides an interface for vertically arranging form elements in a column-like manner. It’s particularly useful for grouping form fields or other layout components in vertical stacks within a broader grid layout.
Example:
layout = Layout(
Row(
Column('first_name', 'last_name', desktop=8, tablet=6),
'sex_options'
)
)
viewflow.forms.
Span
(field_name, **kwargs)¶Represents a form field spanned over multiple columns within a layout.
The Span class allows form fields to span across multiple columns in a layout. By default, the span size is determined automatically based on the row’s configuration. However, specific sizes for different device breakpoints (like desktop, tablet, and mobile) can also be provided.
Example:
layout = Layout(
Row(Span('first_name'), Span('last_name')),
Row(
Span('email', tablet=6, mobile=3),
'sex'
)
)
viewflow.forms.
FieldSet
(title, *elements, **kwargs)¶viewflow.forms.
FormSet
(formset_field_name: str, card_desktop: int = 12, card_tablet: int = 8, card_mobile: int = 4, **kwargs)¶Render stacked inline.
viewflow.forms.
FormLayout
¶Default form layout.
viewflow.forms.
Caption
(text, **kwargs)¶viewflow.forms.
Tag
(tag_name, text=None, **attrs)¶Represents an HTML tag for custom layout definitions.
Example:
layout = Layout(
"customer_name",
Row("quantity", "unit_price", "total"),
Tag("h4", class_="my_tag", text="Title"),
)