Skip to main content

Open the device change form

Open the device change form (dark theme)
Open the device change form (light theme)

Drag the divider or use the arrow keys to compare themes.

Open the device change form
Open the device change form (dark theme)
Open the device change form (light theme)

Drag the divider or use the arrow keys to compare themes.

  1. FormLayoutOption gives the name and placement of the field groups.
  2. TranslateField displays a text input for each active language.
  3. UnitInput adds a unit beside the numeric input.
  4. The configuration editor has its own full-width block.
  5. The object action appears on the change page for users with permission.
Open the device change form

Django Chassis 1.0.23 · training site with Russian UI

  1. FormLayoutOption gives the name and placement of the field groups.
  2. TranslateField displays a text input for each active language.
  3. UnitInput adds a unit beside the numeric input.
  4. The configuration editor has its own full-width block.
  5. The object action appears on the change page for users with permission.

How to add it​

In catalog_demo/admins/device_admin.py, add these options to DeviceAdmin.options. A form row has 12 columns. Two blocks with span=6 sit side by side, and the full-width block uses span=12.

from django_chassis.options import FormBlockOption, FormLayoutOption, PageHeaderOption

# DeviceAdmin.options
options = [
PageHeaderOption(change_title='Настройки устройства'),
FormLayoutOption(blocks=[
FormBlockOption(title='Устройство', fields=['code', 'name', 'category'], span=6),
FormBlockOption(title='Эксплуатация', fields=['active', 'capacity'], span=6),
FormBlockOption(title='Конфигурация', fields=['settings'], span=12),
]),
]

The screenshot also uses a translated name field and custom widgets. See the widget recipe and localized model fields.