Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-slug-model-mixin-0.2.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

django_slug_model_mixin-0.2.0-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-slug-model-mixin-0.2.0.tar.gz.

File metadata

  • Download URL: django-slug-model-mixin-0.2.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for django-slug-model-mixin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 41ff79804ccd80bee463d99bac89a7cbf805964d0a93bb66c9364f2db8504481
MD5 7828ac6633fbe7ed2ea8d35b80bca3b6
BLAKE2b-256 60d9152272176c5f7e0bceb8699b366a1616ff7d11bbfeb6a01a820a966a5708

See more details on using hashes here.

Provenance

File details

Details for the file django_slug_model_mixin-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_slug_model_mixin-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for django_slug_model_mixin-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8d27dc19030c427a9144534a2f6d27b3f146a1ef3c5b1202258b82755d77346
MD5 46284a437cef78f8dc4dc8df17a0667d
BLAKE2b-256 d6d804279dfa256039a0c9685191f238e8a01aa32008137beb51b4a47643b48c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page