{ "info": { "author": "Janusz Skonieczny", "author_email": "js+pypi@bravelabs.pl", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django :: 1.10", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5" ], "description": "====================\nDjango Model Cleanup\n====================\n\n\n.. image:: https://img.shields.io/pypi/v/django-model-cleanup.svg\n :target: https://pypi.python.org/pypi/django-model-cleanup\n\n.. image:: https://img.shields.io/travis/wooyek/django-model-cleanup.svg\n :target: https://travis-ci.org/wooyek/django-model-cleanup\n\n.. image:: https://readthedocs.org/projects/django-model-cleanup/badge/?version=latest\n :target: https://django-model-cleanup.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. image:: https://coveralls.io/repos/github/wooyek/django-model-cleanup/badge.svg?branch=develop\n :target: https://coveralls.io/github/wooyek/django-model-cleanup?branch=develop\n :alt: Coveralls.io coverage\n\n.. image:: https://codecov.io/gh/wooyek/django-model-cleanup/branch/develop/graph/badge.svg\n :target: https://codecov.io/gh/wooyek/django-model-cleanup\n :alt: CodeCov coverage\n\n.. image:: https://api.codeclimate.com/v1/badges/0e7992f6259bc7fd1a1a/maintainability\n :target: https://codeclimate.com/github/wooyek/django-model-cleanup/maintainability\n :alt: Maintainability\n\n.. image:: https://img.shields.io/github/license/wooyek/django-model-cleanup.svg\n :target: https://github.com/wooyek/django-model-cleanup/blob/develop/LICENSE\n :alt: License\n\n.. image:: https://img.shields.io/twitter/url/https/github.com/wooyek/django-model-cleanup.svg?style=social\n :target: https://twitter.com/intent/tweet?text=Wow:&url=https://github.com/wooyek/django-model-cleanup\n :alt: Tweet about this project\n\n.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\n :target: https://saythanks.io/to/wooyek\n\nMixins for model cleanup methods and validation error concatenations\n\n* Free software: MIT license\n* Documentation: https://django-model-cleanup.readthedocs.io.\n\nFeatures of CleanMixin\n----------------------\n\n* Provides `clean` method implementation\n* Call to `full_clean` will result in call to all `clean_*` methods\n* All methods will get called regardless of validation errors - get all errors at once\n* Auto mapping of errors to field names based on clean method names, if errors have no error_dict\n\nQuickstart\n----------\n\nInstall Django Model Cleanup::\n\n pip install django-model-cleanup\n\nAdd mixin in your models and enjoy `clean_` method collection and error concatenation when `full_clean` is called:\n\n.. code-block:: python\n\n from django.core.exceptions import ValidationError\n from django.db import models\n from django.utils.translation import ugettext_lazy as _\n from django_model_cleanup import CleanMixin, ExtensibleValidationError\n\n\n class SomeModel(CleanMixin, models.Model):\n lorem = models.CharField(max_length=10, blank=True)\n\n def clean_foo(self):\n raise ValidationError('Foo is bad')\n\n def clean_bar(self):\n raise ExtensibleValidationError({'bar': _('Bar is wrong cause %s > %s!')}, code='bar', params=(2, 1))\n\n def clean_legacy(self):\n # We can't init ValidationError as one-liner, cause dict + params are not compatible\n # We need to wrap a message in ValidationError and put that in dict indicating a field\n msg = _('Bar legacy error %s > %s!')\n error = ValidationError(msg, code='bar', params=(7, 5))\n raise ValidationError({'bar': error})\n\nEach error handling and concatenation is no longer required:\n\n.. code-block:: python\n\n # This is not longer required:\n def clean(self):\n errors = []\n try:\n self.clean_foo()\n except ValidationError as ex:\n errors.append(ex)\n errors = []\n try:\n self.clean_bar()\n except ValidationError as ex:\n errors.append(ex)\n errors = []\n try:\n self.clean_legacy()\n except ValidationError as ex:\n errors.append(ex)\n if errors:\n raise ValidationError(errors)\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n $ pipenv install --dev\n $ pipenv shell\n $ tox\n\n\nWe recommend using pipenv_ but a legacy approach to creating virtualenv and installing requirements should also work.\nPlease install `requirements/development.txt` to setup virtual env for testing and development.\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `wooyek/cookiecutter-django-app`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`wooyek/cookiecutter-django-app`: https://github.com/wooyek/cookiecutter-django-app\n.. _`pipenv`: https://docs.pipenv.org/install.html#fancy-installation-of-pipenv\n\n\n\n\nHistory\n-------\n\n0.1.0 (2017-12-05)\n++++++++++++++++++\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wooyek/django-model-cleanup", "keywords": "django-model-cleanup", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "django-model-cleanup", "package_url": "https://pypi.org/project/django-model-cleanup/", "platform": "", "project_url": "https://pypi.org/project/django-model-cleanup/", "project_urls": { "Homepage": "https://github.com/wooyek/django-model-cleanup" }, "release_url": "https://pypi.org/project/django-model-cleanup/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Mixins for model cleanup methods and validation error concatenations", "version": "0.1.1" }, "last_serial": 3391848, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "aa313385bab9b96d42d498b575614050", "sha256": "788909682e4a572059f8b568eb3ddd1d4bababa18c750637d3cb8de8b1453166" }, "downloads": -1, "filename": "django_model_cleanup-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa313385bab9b96d42d498b575614050", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 8555, "upload_time": "2017-12-05T21:08:21", "url": "https://files.pythonhosted.org/packages/f0/2b/44efc0669610cb3b5613075501dd587ee0f58ff044baeb00455cf8ce4062/django_model_cleanup-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19bb04e31708d431e514dcf5f6ecc0ea", "sha256": "0fd7a92543e69e1d6007c064855e5705220409f74582859332639f268eb55e2a" }, "downloads": -1, "filename": "django-model-cleanup-0.1.1.tar.gz", "has_sig": false, "md5_digest": "19bb04e31708d431e514dcf5f6ecc0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30142, "upload_time": "2017-12-05T21:08:19", "url": "https://files.pythonhosted.org/packages/6b/13/b49e114de028082ee14db160e46f7db0ee52d0da1f730b0b9bd3c0d121a2/django-model-cleanup-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa313385bab9b96d42d498b575614050", "sha256": "788909682e4a572059f8b568eb3ddd1d4bababa18c750637d3cb8de8b1453166" }, "downloads": -1, "filename": "django_model_cleanup-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa313385bab9b96d42d498b575614050", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 8555, "upload_time": "2017-12-05T21:08:21", "url": "https://files.pythonhosted.org/packages/f0/2b/44efc0669610cb3b5613075501dd587ee0f58ff044baeb00455cf8ce4062/django_model_cleanup-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "19bb04e31708d431e514dcf5f6ecc0ea", "sha256": "0fd7a92543e69e1d6007c064855e5705220409f74582859332639f268eb55e2a" }, "downloads": -1, "filename": "django-model-cleanup-0.1.1.tar.gz", "has_sig": false, "md5_digest": "19bb04e31708d431e514dcf5f6ecc0ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30142, "upload_time": "2017-12-05T21:08:19", "url": "https://files.pythonhosted.org/packages/6b/13/b49e114de028082ee14db160e46f7db0ee52d0da1f730b0b9bd3c0d121a2/django-model-cleanup-0.1.1.tar.gz" } ] }