Skip to content

Commit

Permalink
Add documentation details
Browse files Browse the repository at this point in the history
  • Loading branch information
rtpg committed Jul 25, 2024
1 parent 5ead624 commit c2147e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ tagging to your project easy and fun.
forms
admin
serializers
testing
api
faq
custom_tagging
Expand Down
14 changes: 14 additions & 0 deletions docs/testing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Testing
=======

Natural Key Support
-------------------
We have added `natural key support <https://docs.djangoproject.com/en/5.0/topics/serialization/#natural-keys>`_ 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.

0 comments on commit c2147e8

Please sign in to comment.