=============================
Django Slug Model Mixin
=============================
.. image:: https://badge.fury.io/py/django-slug-model-mixin.svg
:target: https://badge.fury.io/py/django-slug-model-mixin
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest&style=flat-square
:target: https://django-slug-model-mixin.readthedocs.io/en/latest/
.. image:: https://img.shields.io/coveralls/github/frankhood/django-slug-model-mixin/main?style=flat-square
:target: https://coveralls.io/github/frankhood/django-slug-model-mixin?branch=main
:alt: 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`:
.. code-block:: python
INSTALLED_APPS = (
...
'slug_model_mixin',
...
)
Use the SlugModelMixin in your model:
.. code-block:: python
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:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
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
Raw data
{
"_id": null,
"home_page": "https://github.com/frankhood/django-slug-model-mixin",
"name": "django-slug-model-mixin",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "django-slug-model-mixin",
"author": "FrankHood Business Solutions srl",
"author_email": "info@frankhood.it",
"download_url": "https://files.pythonhosted.org/packages/39/40/1a8cfc76c5df244b429e3d891d7a11cc7a90001eac81de4b641bd54f993f/django-slug-model-mixin-0.3.0.tar.gz",
"platform": null,
"description": "=============================\nDjango Slug Model Mixin\n=============================\n\n.. image:: https://badge.fury.io/py/django-slug-model-mixin.svg\n :target: https://badge.fury.io/py/django-slug-model-mixin\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest&style=flat-square\n :target: https://django-slug-model-mixin.readthedocs.io/en/latest/\n\n.. image:: https://img.shields.io/coveralls/github/frankhood/django-slug-model-mixin/main?style=flat-square\n :target: https://coveralls.io/github/frankhood/django-slug-model-mixin?branch=main\n :alt: Coverage Status\n\nSlugify model mixin to manage slugged fields in your project models.\n\nDocumentation\n-------------\n\nThe full documentation is at https://django-slug-model-mixin.readthedocs.io.\n\nQuickstart\n----------\n\nInstall Django Slug Model Mixin::\n\n pip install django-slug-model-mixin\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'slug_model_mixin',\n ...\n )\n\nUse the SlugModelMixin in your model:\n\n.. code-block:: python\n\n class ExampleModel(SlugModelMixin, models.Model):\n slugged_field = 'name' # insert the name of the field you want to slugify\n slug_unique = False # remove unique for your slug\n force_slugify = True # force the slugify using uuslug\n\n name = models.CharField(\n 'Name',\n max_length=255\n )\n\n class Meta:\n verbose_name = 'Example Model'\n verbose_name_plural = 'Example Models'\n\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source <YOURVIRTUALENV>/bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\n\nDevelopment commands\n---------------------\n\n::\n\n pip install -r requirements_dev.txt\n invoke -l\n\n\nCredits\n-------\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.1.1 (2021-10-07)\n++++++++++++++++++\n\n* First release on PyPI.\n\n0.1.2 (2021-09-07)\n++++++++++++++++++\n\n* Rework on Mixin to work only on py3\n\n0.1.3 (2021-10-07)\n++++++++++++++++++\n\n* Rework configurations and README\n\n0.1.4 (2021-10-07)\n++++++++++++++++++\n\n* Rework configurations and added github actions\n\n0.1.5 (2021-10-07)\n++++++++++++++++++\n\n* Added pipy on github actions and fixed setup.py\n\n0.1.6 (2021-10-07)\n++++++++++++++++++\n\n* Changed from test.pipy.org to pipy.org\n\n0.1.7 (2021-10-07)\n++++++++++++++++++\n\n* Updated github action\n\n0.1.7 (2021-10-07)\n++++++++++++++++++\n\n* Updated github action\n\n0.1.8 (2021-10-19)\n++++++++++++++++++\n\n* Updated version for github actions and changed name to django-slug-model-mixin\n\n0.1.9 (2021-10-19)\n++++++++++++++++++\n\n* Updated version for github actions\n\n0.2.0 (2021-11-22)\n++++++++++++++++++\n\n* Fixed slug with spaces bug\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Slugify model mixin to manage slugged fields in your project models.",
"version": "0.3.0",
"project_urls": {
"Homepage": "https://github.com/frankhood/django-slug-model-mixin"
},
"split_keywords": [
"django-slug-model-mixin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c6d06d1f9bdedbf5203fb81c9eccc1869161d087d75f71feb55e7bcd5c260c12",
"md5": "0e45cbd19197026f1f3e81844f91067c",
"sha256": "4a2fc42f5569f3f2624a5ea60654b0591e65e7c2ba399e8bba7c9bf8b430d7d0"
},
"downloads": -1,
"filename": "django_slug_model_mixin-0.3.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e45cbd19197026f1f3e81844f91067c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4659,
"upload_time": "2024-02-20T10:23:39",
"upload_time_iso_8601": "2024-02-20T10:23:39.039137Z",
"url": "https://files.pythonhosted.org/packages/c6/d0/6d1f9bdedbf5203fb81c9eccc1869161d087d75f71feb55e7bcd5c260c12/django_slug_model_mixin-0.3.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "39401a8cfc76c5df244b429e3d891d7a11cc7a90001eac81de4b641bd54f993f",
"md5": "6e2399e2e228791269e733f5c7093b79",
"sha256": "1cf7bfc7bd491a81ad21a845673531e3d53db4f08edb02d65c4cda57d823f02e"
},
"downloads": -1,
"filename": "django-slug-model-mixin-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "6e2399e2e228791269e733f5c7093b79",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6525,
"upload_time": "2024-02-20T10:23:40",
"upload_time_iso_8601": "2024-02-20T10:23:40.724132Z",
"url": "https://files.pythonhosted.org/packages/39/40/1a8cfc76c5df244b429e3d891d7a11cc7a90001eac81de4b641bd54f993f/django-slug-model-mixin-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-20 10:23:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "frankhood",
"github_project": "django-slug-model-mixin",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "django-slug-model-mixin"
}