From 7407e3927ee991010609b6ab56670c73c9b690a8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 29 Oct 2017 10:14:11 +0100 Subject: Makefile: update town fixture generation --- Makefile.example | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile.example') diff --git a/Makefile.example b/Makefile.example index b3016e8af..9a3e5ccb4 100644 --- a/Makefile.example +++ b/Makefile.example @@ -142,11 +142,13 @@ fixtures_common_importers: > '../ishtar_common/fixtures/initial_importtypes-'$(default_data)'.json' fixtures_common_towns: - cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 \ - ishtar_common.state \ + cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 --natural-primary --natural-foreign \ ishtar_common.department \ ishtar_common.town \ - > '../ishtar_common/fixtures/initial_towns-'$(default_data)'.json' + > '../ishtar_common/fixtures/towns-'$(default_data)'.json' + cat 'ishtar_common/fixtures/towns-'$(default_data)'.json' | tr '\n' '\r' | \ + sed -e 's/"children": *\[\r *\[\r *"[0-9]*", *\r *[0-9]*\ *\r *\]\r *\]/"children": []/g' | \ + tr '\r' '\n' > 'ishtar_common/fixtures/towns_norel-'$(default_data)'.json' fixtures_spatialrefsystem: cd $(project); $(PYTHON) ./manage.py dumpdata --indent 4 --natural-primary --natural-foreign \ -- cgit v1.2.3