Skip to content

Make sync_templates command more flexible

Petr Stribny requested to merge 2611-sync-subset-templates into develop

The changes were made to:

  1. Use regular expression instead of globbing for sync_template command which enables syncing a couple of specific templates, e.g. django-admin sync_templates --only="(all-fields|car-hunt)" and support previous behavior like matching multiple templates with e.g. a common prefix django-admin sync_templates --only="^job.*"

It is also not necessary to use the ".json" at the end to match the proper template files.

  1. Adds BASEROW_SYNC_TEMPLATES_PATTERN env var that is automatically picked up on startup and syncs only the templates defined as a pattern here.

  2. Running django-admin sync_templates without any parameter will sync all templates as before. However if needed, it is possible to invoke django-admin sync_templates --from-env to sync templates defined in the env var in case folks don't sync templates on startup or want to rerun the sync.

Edited by Petr Stribny

Merge request reports

Loading