{ "info": { "author": "Horst Gutmann", "author_email": "horst@zerokspot.com", "bugtrack_url": null, "classifiers": [], "description": "django-validatorchain\n#####################\n\n\nMotivation\n==========\n\nWhile working on the EuroPython 2014 website we ran into a situation where we\nhad a field validator that was rather expensive to evaluate.\n\nSadly, the `validators-attribute`_ on a model/form field is always evaluated as\na whole (meaning each validator in that list is executed no matter if a previous\none errored out already). So, we wanted to have a way to mark certain validators\nas not to be executed in case the field was being marked as invalid anyway.\n\nWe still wanted to use the field validator API simply because it keeps\neverything easily testible, though.\n\n\nHow to use\n==========\n\n::\n\n from django.db import models\n\n from validatorchain import ValidatorChain\n\n from .validators import a_cheap_validator\n from .validators import another_cheap_validator\n from .validators import an_expensive_validator\n\n\n class SomeModel(models.Model):\n field = models.CharField(\n max_length=100,\n validators=ValidatorChain()\n .add(a_cheap_validator)\n .add(an_expensive_validator, skip_on_error=True)\n .add(another_cheap_validator)\n )\n\nThis way `an_expensive_validator` will not be executed if `a_cheap_validator`\nalready raised an exception, while `another_cheap_validator` will be executed\nagain.\n\n\n.. _validators-attribute: https://docs.djangoproject.com/en/1.5/ref/forms/validation/#validators", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zerok/django-validatorchain", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-validatorchain", "package_url": "https://pypi.org/project/django-validatorchain/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-validatorchain/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/zerok/django-validatorchain" }, "release_url": "https://pypi.org/project/django-validatorchain/0.1/", "requires_dist": null, "requires_python": null, "summary": "Helper for making form validators skippable", "version": "0.1" }, "last_serial": 994974, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5b48005a1e6cc15c39e3e9d66d1db9ce", "sha256": "7b65379c83d597c97c6a761163f1464161beb0e8f53d05085653be6763e41f5e" }, "downloads": -1, "filename": "django-validatorchain-0.1.tar.gz", "has_sig": false, "md5_digest": "5b48005a1e6cc15c39e3e9d66d1db9ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2008, "upload_time": "2014-02-09T12:23:29", "url": "https://files.pythonhosted.org/packages/33/51/9d5453537f6a827dbfc6c9a0a9b57895fce551b9bf20c729d0fd6360cc84/django-validatorchain-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5b48005a1e6cc15c39e3e9d66d1db9ce", "sha256": "7b65379c83d597c97c6a761163f1464161beb0e8f53d05085653be6763e41f5e" }, "downloads": -1, "filename": "django-validatorchain-0.1.tar.gz", "has_sig": false, "md5_digest": "5b48005a1e6cc15c39e3e9d66d1db9ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2008, "upload_time": "2014-02-09T12:23:29", "url": "https://files.pythonhosted.org/packages/33/51/9d5453537f6a827dbfc6c9a0a9b57895fce551b9bf20c729d0fd6360cc84/django-validatorchain-0.1.tar.gz" } ] }