Skip to main content

Select a file and the destination fields

Select a file and the destination fields (dark theme)
Select a file and the destination fields (light theme)

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

Select a file and the destination fields
Select a file and the destination fields (dark theme)
Select a file and the destination fields (light theme)

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

  1. Upload a JSON file with an array of device records.
  2. The ModelAdmin allowlist controls the fields available for import.
  3. Check file opens the validation step before import begins.
Select a file and the destination fields

Django Chassis 1.0.23 · training site with Russian UI

  1. Upload a JSON file with an array of device records.
  2. The ModelAdmin allowlist controls the fields available for import.
  3. Check file opens the validation step before import begins.

How to add it​

Add this ImportOption to DeviceAdmin.options in catalog_demo/admins/device_admin.py. Declare both codenames on Device.Meta.permissions in catalog_demo/models/device.py and apply migrations. Give the uploader's group catalog_demo.view_device and both import grants. Register the admin on the Chassis site and configure private STORAGES['media'] in Django settings.

from django_chassis.enums import ImportFormat
from django_chassis.options import ImportOption

# DeviceAdmin.options entry
ImportOption(
view_permission='view_device_import', upload_permission='upload_device_import',
fields=['code', 'category', 'active', 'capacity', 'settings'],
formats=[ImportFormat.JSON, ImportFormat.XML]
)

Open /admin/catalog_demo/device/import/new/. The next example generates a JSON file with a valid category ID for the seeded demo.