diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 74e7ffd..c3d27af 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,8 @@ Change log - Added ``./manage.py f3dumpdata -`` which allows reading JSON data from stdin. - Added Python 3.12 and Django 5.0. +- Order objects by their primary key when dumping specs. This helps with + comparing JSON files by hand. 0.6 (2023-06-12) diff --git a/feincms3_data/data.py b/feincms3_data/data.py index 1c93038..dfdb7f3 100644 --- a/feincms3_data/data.py +++ b/feincms3_data/data.py @@ -79,7 +79,7 @@ def specs_for_app_models(app, spec=None): def _model_queryset(spec): - queryset = apps.get_model(spec["model"])._default_manager.all() + queryset = apps.get_model(spec["model"])._default_manager.order_by("pk") if f := spec.get("filter"): queryset = queryset.filter(**f) return queryset