Skip to main content

Django Slug Model Mixin

https://badge.fury.io/py/django-slug-model-mixin.svg https://readthedocs.org/projects/pip/badge/?version=latest&style=flat-square Coverage Status

Slugify model mixin to manage slugged fields in your project models.

Documentation

The full documentation is at https://django-slug-model-mixin.readthedocs.io.

Quickstart

Install Django Slug Model Mixin:

pip install django-slug-model-mixin

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'slug_model_mixin',
    ...
)

Use the SlugModelMixin in your model:

class ExampleModel(SlugModelMixin, models.Model):
    slugged_field = 'name'  # insert the name of the field you want to slugify
    slug_unique = False # remove unique for your slug
    force_slugify = True # force the slugify using uuslug

    name = models.CharField(
        'Name',
        max_length=255
    )

class Meta:
    verbose_name = 'Example Model'
    verbose_name_plural = 'Example Models'

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Development commands

pip install -r requirements_dev.txt
invoke -l

Credits

Tools used in rendering this package:

History

0.1.1 (2021-10-07)

  • First release on PyPI.

0.1.2 (2021-09-07)

  • Rework on Mixin to work only on py3

0.1.3 (2021-10-07)

  • Rework configurations and README

0.1.4 (2021-10-07)

  • Rework configurations and added github actions

0.1.5 (2021-10-07)

  • Added pipy on github actions and fixed setup.py

0.1.6 (2021-10-07)

  • Changed from test.pipy.org to pipy.org

0.1.7 (2021-10-07)

  • Updated github action

0.1.7 (2021-10-07)

  • Updated github action

0.1.8 (2021-10-19)

  • Updated version for github actions and changed name to django-slug-model-mixin

0.1.9 (2021-10-19)

  • Updated version for github actions

0.2.0 (2021-11-22)

  • Fixed slug with spaces bug

Metadata

Release files for django-slug-model-mixin 0.3.0

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-slug-model-mixin 0.3.0
File Size Uploaded Provenance Actions
django-slug-model-mixin-0.3.0.tar.gz 6.5 kB Without provenance Details for django-slug-model-mixin-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-slug-model-mixin 0.3.0
File Interpreter ABI Platform Actions
django_slug_model_mixin-0.3.0-py2.py3-none-any.whl Python 3, Python 2 none any Details for django_slug_model_mixin-0.3.0-py2.py3-none-any.whl

Total release size: 11.2 kB

Release files / django-slug-model-mixin-0.3.0.tar.gz

Download URL django-slug-model-mixin-0.3.0.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1cf7bfc7bd491a81ad21a845673531e3d53db4f08edb02d65c4cda57d823f02e
BLAKE2b-256 checksum
How to use checksums
39401a8cfc76c5df244b429e3d891d7a11cc7a90001eac81de4b641bd54f993f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Release files / django_slug_model_mixin-0.3.0-py2.py3-none-any.whl

Download URL django_slug_model_mixin-0.3.0-py2.py3-none-any.whl
Size 4.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4a2fc42f5569f3f2624a5ea60654b0591e65e7c2ba399e8bba7c9bf8b430d7d0
BLAKE2b-256 checksum
How to use checksums
c6d06d1f9bdedbf5203fb81c9eccc1869161d087d75f71feb55e7bcd5c260c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.18

Security for django-slug-model-mixin 0.3.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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