{ "info": { "author": "RedTurtle Technology", "author_email": "sviluppoplone@redturtle.it", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Plone", "Framework :: Plone :: 3.3", "Framework :: Plone :: 4.0", "Framework :: Plone :: 4.1", "Framework :: Plone :: 4.2", "Intended Audience :: Developers", "Programming Language :: Python" ], "description": ".. contents:: **Table of contents**\r\n\r\nIntroduction\r\n============\r\n\r\nThis product add to Plone some additional `validators`__.\r\n\r\n__ http://plone.org/documentation/manual/developer-manual/archetypes/fields/validator-reference\r\n\r\nSome of theme can be useful only for Italian users or sites targeted on Italy (as many of the default ones\r\nlike ``isSSN`` or ``isUSPhoneNumber`` are not useful for non-US sites), other are simply additional validators\r\nthat everyone can find useful.\r\n\r\nThe idea behind the product is simply collect a set of validators that commonly are putted inside other\r\nproducts, but in this way not easily reusable.\r\n\r\nItalian Specific validators\r\n===========================\r\n\r\nisCAP\r\n-----\r\n\r\nVery similar to the native ``isZipCode`` but this only accept 5 digits values. Formally is\r\n`Codice di Avviamento Postale`__.\r\n\r\n__ http://it.wikipedia.org/wiki/Codice_di_avviamento_postale\r\n\r\nisItalianNIN\r\n------------\r\n\r\nCheck if a string is a valid `Italian National Insurance Number`__ (\"Codice Fiscale\"). The validator only check\r\nthe format of the string, not if the string itself is a *real* and existing code.\r\n\r\n__ http://it.wikipedia.org/wiki/Codice_fiscale\r\n\r\nGeneral purpose validators\r\n==========================\r\n\r\nMinCharsValidator\r\n-----------------\r\n\r\nThis validator test if the given value is at least a specific number of characters long. The default\r\ncharacter value is 500.\r\n\r\nThe validator will also ignore any whitespace (space character, carriage return, tab...) so the text::\r\n\r\n Hello World\r\n\r\nis long like::\r\n\r\n Hello World\r\n\r\nand also long like::\r\n\r\n Hello \r\n \r\n World\r\n\r\nHow to use\r\n~~~~~~~~~~\r\n\r\nAn example::\r\n\r\n from collective.itvalidators.validators import MinCharsValidator\r\n ...\r\n \r\n TextField('text',\r\n validators = (MinCharsValidator()),\r\n ),\r\n ...\r\n\r\nTo customize the number of characters::\r\n\r\n TextField('text',\r\n validators = (MinCharsValidator(100)),\r\n ),\r\n ...\r\n\r\nYou can also threat is a special way HTML text (for example, if it came from TinyMCE) beeing sure that only\r\ncontent characters (not HTML tags) are counted. Example::\r\n\r\n ...\r\n TextField('text',\r\n default_output_type = 'text/x-html-safe',\r\n validators = ('isTidyHtmlWithCleanup', MinCharsValidator(100, strict=True)),\r\n ),\r\n ...\r\n\r\nDependencyCheckValidator\r\n------------------------\r\n\r\nThis validator check the value (\"*wanted value*\") contained in a field, but only when another field contains\r\na \"*warning value*\".\r\nThis mean that when the *observed* field isn't matching the value you are monitor, no validation take place;\r\nwhen this is true, a second level of validation of the current field take place.\r\n\r\nYou need to configure this validator giving the ``observed`` field. After that you need to provide both\r\n``warnValue`` and ``wantedValue``.\r\n\r\nExample:\r\n\r\n Check that when an observed field contains the value \"*Other...*\", this field contains the value \"*Foo*\".\r\n\r\nThis first example seems not very useful but know that both configuration parameters can be a specific\r\nvalue, or a boolean value.\r\n\r\nWhen using boolean values:\r\n\r\n* When ``warnValue`` is *False* mean that you want to monitor when the *observed* field is empty.\r\n* When ``warnValue`` is *True* mean that you want to monitor when the *observed* field is not empty.\r\n* When ``wantedValue`` is *False* mean that validation will pass if the field if empty.\r\n* When ``wantedValue`` is *True* mean that validation will pass if the field not empty (see below).\r\n\r\nAnother (better) example:\r\n\r\n Check that when an observed field contains the value \"*Other...*\", this field contains *something*.\r\n\r\nHow to use\r\n~~~~~~~~~~\r\n\r\nThe first example above::\r\n\r\n from collective.itvalidators.validators import DependencyCheckValidator\r\n ...\r\n \r\n StringField('field1',),\r\n StringField('field2',\r\n validators = (DependencyCheckValidator('field1', warnValue='Other...', wantedValue='Foo')),\r\n ),\r\n ...\r\n\r\nThe second example above::\r\n\r\n ...\r\n StringField('field1',),\r\n StringField('field2',\r\n validators = (DependencyCheckValidator('field1', warnValue='Other...', wantedValue=True)),\r\n ),\r\n ...\r\n\r\nFinal note\r\n~~~~~~~~~~\r\n\r\nNormally Archetypes framework doesn't run validation for non-required empty fields. This happens adding as first validator\r\na default sufficient \"*isEmptyNoError*\".\r\n\r\nYou probably need to play with Products.validation APIs to use ``wantedValue`` True::\r\n\r\n YourSchema['field2'].validators.insertRequired(\r\n DependencyCheckValidator('field1', warnValue='Other...', wantedValue=True)\r\n )\r\n\r\nThis will add in position 0 a required validator. In this way the validation runs normally.\r\n\r\nContribute!\r\n===========\r\n\r\nYou are welcome to add to this product your additional validation (also some unit-tests for every new validator\r\nare welcome)! Contact us at sviluppoplone@redturtle.it\r\n\r\nYou can also contribute providing new translation for validation messages.\r\n\r\nCredits\r\n=======\r\n\r\nDeveloped with the support of:\r\n\r\n* `Azienda USL Ferrara`__\r\n \r\n .. image:: http://www.ausl.fe.it/logo_ausl.gif\r\n :alt: Azienda USL's logo\r\n \r\n* `S. Anna Hospital, Ferrara`__\r\n\r\n .. image:: http://www.ospfe.it/ospfe-logo.jpg \r\n :alt: S. Anna Hospital - logo\r\n \r\n* `Regione Emilia Romagna`__\r\n\r\nAll of them supports the `PloneGov initiative`__.\r\n\r\n__ http://www.ausl.fe.it/\r\n__ http://www.ospfe.it/\r\n__ http://www.regione.emilia-romagna.it/\r\n__ http://www.plonegov.it/\r\n\r\nAuthors\r\n=======\r\n\r\nThis product was developed by RedTurtle Technology team.\r\n\r\n.. image:: http://www.redturtle.it/redturtle_banner.png\r\n :alt: RedTurtle Technology Site\r\n :target: http://www.redturtle.it/\r\n\r\n\r\nChangelog\r\n=========\r\n\r\n1.0.0 (2012-11-12)\r\n------------------\r\n\r\n* fix interfaces implements method for Plone 4 [fdelia]\r\n* Fixed tests for Plone 4.2 [keul]\r\n\r\n0.3.0 (2012-05-02)\r\n------------------\r\n\r\n* added a specific support for DataGridField empty values using ``wantedValue``.\r\n Please *note* that this has been tested with DataGridField 1.6\r\n [keul]\r\n\r\n0.2.1 (2012-02-09)\r\n------------------\r\n\r\n* fixed error when fields provide a custom i18n Message string.\r\n Overriding the default ones was not possible [keul]\r\n\r\n0.2.0 (2012-02-07)\r\n------------------\r\n\r\n* new validator: ``DependencyCheckValidator`` [keul]\r\n* fixed translations [keul]\r\n\r\n0.1.0 (2011-05-03)\r\n------------------\r\n\r\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://plone.org/products/collective.itvalidators", "keywords": "plone archetypes validator plonegov", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.itvalidators", "package_url": "https://pypi.org/project/collective.itvalidators/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.itvalidators/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://plone.org/products/collective.itvalidators" }, "release_url": "https://pypi.org/project/collective.itvalidators/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "A set of Archetypes validators for Plone, some for Italian specific needs, others useful for all", "version": "1.0.0" }, "last_serial": 1771518, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4498e105da624aa46ebace2ac889c7f3", "sha256": "d58b19c7666885c160b027d882966ca9251d65e37b343f639e24ec646c45b729" }, "downloads": -1, "filename": "collective.itvalidators-0.1.0-py2.6.egg", "has_sig": false, "md5_digest": "4498e105da624aa46ebace2ac889c7f3", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 13662, "upload_time": "2011-05-03T12:00:01", "url": "https://files.pythonhosted.org/packages/03/4f/c33d2accb18ff1dee2078f80ddea0d4091fb5928c27e1673cb8b54e5bc30/collective.itvalidators-0.1.0-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "d07ccc780d734909c114396aa246b4e9", "sha256": "a4af049b79451ef9894b30f77c74fd7484d3bca975f0f21331a80c2fea650f0e" }, "downloads": -1, "filename": "collective.itvalidators-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d07ccc780d734909c114396aa246b4e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14833, "upload_time": "2011-05-03T12:00:00", "url": "https://files.pythonhosted.org/packages/93/5e/f6f8bef4d664dbc1fe7dd20530400e7044b67b67660462aaace240962322/collective.itvalidators-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "da25ae6b71bce6fd83c2a227dcb995fd", "sha256": "1b862e0829a50b14ed5f52da25778ecd6a0fb227c4f6d53307d0905aedf51eeb" }, "downloads": -1, "filename": "collective.itvalidators-0.2.0.tar.gz", "has_sig": false, "md5_digest": "da25ae6b71bce6fd83c2a227dcb995fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18296, "upload_time": "2012-02-07T09:39:12", "url": "https://files.pythonhosted.org/packages/1a/e1/2d6a24f4bb9c7e04f0e64ea39dc665b1d9bc131fdd4bd5c035511870a9c8/collective.itvalidators-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f963dc77bdc9d0c860b7d752679695b6", "sha256": "eea84184f36ba1778a59c86743998337298e9da4ec076d65545ff426093dc8e7" }, "downloads": -1, "filename": "collective.itvalidators-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f963dc77bdc9d0c860b7d752679695b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18504, "upload_time": "2012-02-09T16:04:49", "url": "https://files.pythonhosted.org/packages/19/c5/b0bc4bd1500f88a9bd16d450efe43a8ea2d3c218e6fc2f3d2d38e0659881/collective.itvalidators-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "94b77b4e97c7fdad5b213d1b619d8c4c", "sha256": "b00c3a77d2a0d42b95d35b4a1bf8d03875c4f4f31d30d2e9a0b611cc20ac76a1" }, "downloads": -1, "filename": "collective.itvalidators-0.3.0.tar.gz", "has_sig": false, "md5_digest": "94b77b4e97c7fdad5b213d1b619d8c4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19069, "upload_time": "2012-05-02T17:06:48", "url": "https://files.pythonhosted.org/packages/05/3b/e24f5cc462fdd9e1d0379232cdd2f6b69b2ea565712ec17951941adc7a3a/collective.itvalidators-0.3.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "2322fe385408624ed7ef0515905c3b45", "sha256": "2fd5a372634491784fcc5713731325602d7da70cdf807ed306bf0349a0b6c275" }, "downloads": -1, "filename": "collective.itvalidators-1.0.0.zip", "has_sig": false, "md5_digest": "2322fe385408624ed7ef0515905c3b45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30042, "upload_time": "2012-11-12T13:51:23", "url": "https://files.pythonhosted.org/packages/78/e3/a244c6637f57b5041ff40f9ab0deb85c2e80544a387d73e230d04e4d7bd4/collective.itvalidators-1.0.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2322fe385408624ed7ef0515905c3b45", "sha256": "2fd5a372634491784fcc5713731325602d7da70cdf807ed306bf0349a0b6c275" }, "downloads": -1, "filename": "collective.itvalidators-1.0.0.zip", "has_sig": false, "md5_digest": "2322fe385408624ed7ef0515905c3b45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30042, "upload_time": "2012-11-12T13:51:23", "url": "https://files.pythonhosted.org/packages/78/e3/a244c6637f57b5041ff40f9ab0deb85c2e80544a387d73e230d04e4d7bd4/collective.itvalidators-1.0.0.zip" } ] }