diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 874aa235..24bc6c62 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,7 +10,7 @@ Changelog We believe that this should not cause a noticable performance change, and the number of queries involved should not change. * Add Django 5.0 support (no code changes were needed, but now we test this release). * Add Python 3.12 support -* Add Support for dumpdata/loaddata using Natural Keys +* Add support for dumpdata/loaddata using natural keys 5.0.1 (2023-10-26) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/index.rst b/docs/index.rst index 611c28d3..db978980 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,6 +13,7 @@ tagging to your project easy and fun. forms admin serializers + testing api faq custom_tagging diff --git a/docs/testing.rst b/docs/testing.rst new file mode 100644 index 00000000..a18763e7 --- /dev/null +++ b/docs/testing.rst @@ -0,0 +1,14 @@ +Testing +======= + +Natural Key Support +------------------- +We have added `natural key support `_ to the Tag model in the Django taggit library. This allows you to identify objects by human-readable identifiers rather than by their database ID:: + + python manage.py dumpdata taggit.Tag --natural-foreign --natural-primary > tags.json + + python manage.py loaddata tags.json + +By default tags use the name field as the natural key. + +You can customize this in your own custom tag model by setting the ``natural_key_fields`` property on your model the required fields.