Skip to content

natural-keys 1.5.0

Compare
Choose a tag to compare
@sheppard sheppard released this 01 Mar 04:44
542d905

natural-keys 1.5.0 ensures that natural_key_slug can only be passed as a kwarg to NaturalKeyQuerySet.filter(). The implementation in 1.4.0 was breaking the common use case of passing in a Q object as the first argument (#8). This was fixed thanks to contributions from @arvindch (#9), @marcosox (#10), and @github-account-because-they-want-it (#11).

Note: If you were relying on this (unintended) feature, you will need to update any instances of e.g. MyModel.objects.get("abc-123") with one of the following:

  • MyModel.objects.get(natural_key_slug="abc-123")
  • MyModel.objects.get_by_natural_key("abc", "123")

Other changes in this version:

  • Option to specify natural key fields via _natural_key instead of Meta.unique_together[0] (#9 via @arvindch)
  • Export NaturalKeyModelManager & NaturalKeyQuerySet in top level module (#9)
  • Update test matrix to add Python 3.7 and Django 2.1. Django 1.8 LTS is still included for now though it is technically deprecated.
  • Integrate setuptools_scm; use markdown for PyPI readme; clarify (non-)uses of NaturalKeySerializer,