Skip to content

Commit

Permalink
Deterministic ordering of objects when dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Oct 28, 2024
1 parent 85c737d commit 5b86412
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion feincms3_data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b86412

Please sign in to comment.