Skip to main content

Better ordering for CharFields. Ignores spaces at the start of a string, does the right thing with integers. Removes “the” at the start of strings, if you’re using naturalsortfield.en.

Example:
>>> from django.db import models
>>> from naturalsortfield.en import NaturalSortFieldEn
...
>>> class MyModel(models.Model):
...     title = models.CharField(max_length=255)
...     title_sort = NaturalSortFieldEn()
...
>>> MyModel.objects.create(title='XYZ 10')
>>> MyModel.objects.create(title='XYZ 1')
>>> MyModel.objects.create(title='ABC')
>>> MyModel.objects.create(title='The XYZ 2')
>>> [obj.title for obj.title in MyModel.objects.order_by('title_sort')
['ABC', 'XYZ 1', 'The XYZ 2', 'XYZ 10']

Metadata

Release files for django-naturalsortfield 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-naturalsortfield 0.7
File Size Uploaded Provenance
django-naturalsortfield-0.7.tar.gz 2.6 kB Without provenance Details

Release files / django-naturalsortfield-0.7.tar.gz

Download URL django-naturalsortfield-0.7.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ff9803a80bc40c4f9271ff902c241b885ee423ba1b2765ddc6573b54a4dbd83c
BLAKE2b-256 checksum
How to use checksums
279ea3c78f24155ca278bc0b7b5968a9b812c6c58030489a7d8415712c9a7639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-naturalsortfield 0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.7 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page