{ "info": { "author": "Daniel Gatis Carrazzoni", "author_email": "danielgatis@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "====================\ndjango-smart-save\n====================\n\nMake ``save`` call ``full_clean``.\n\nDo you think Django models ``save`` method will validate all fields\n(i.e. call ``full_clean``) before saving or any time at all? Wrong!\n\nI discovered this awful truth when I couldn't understand why\na model object with an email field (without `blank=True`) could be\nsaved with an empty string as email address.\n\nMore info:\n\n* \"Why doesn't django's model.save() call full clean?\"\n http://stackoverflow.com/questions/4441539/\n* \"Model docs imply that ModelForm will call Model.full_clean(), but it won't.\"\n https://code.djangoproject.com/ticket/13100\n\n\nInstalling\n==========\n\nFirst add the application to your Python path. The easiest way is to use\n`pip`::\n\n pip install django-smart-save\n\nYou should install by downloading the source and running::\n\n $ python setup.py install\n\nConfiguring\n-----------\n\nMake sure you have `django.contrib.auth` installed, and add the `smart_save`\napplication to your `INSTALLED_APPS` list::\n\n INSTALLED_APPS = (\n ...\n 'django.contrib.auth',\n 'smart_save',\n )\n\nYou can specify a different method name in your project settings (default: save_if_valid):\n\n SMART_SAVE_METHOD = 'my_save'\n\n\nUsage Overview\n==============\n\nIt is simple::\n\n >>> user = User(username=\"chris\")\n >>> user.save_if_valid()\n True\n >>> user = User(username=\"\")\n >>> user.save_if_valid()\n False\n >>> user._errors\n {'username': ['This field cannot be blank.']}\n\nLicense\n=======\n\nAnyone is free to use or modify this software under the terms of the BSD\nlicense.\n", "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/danielgatis/django-smart-save", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-smart-save", "package_url": "https://pypi.org/project/django-smart-save/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-smart-save/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/danielgatis/django-smart-save" }, "release_url": "https://pypi.org/project/django-smart-save/0.0.11/", "requires_dist": null, "requires_python": null, "summary": "Automatically validates when you call your model\u2019s save()", "version": "0.0.11" }, "last_serial": 3141632, "releases": { "0.0.11": [ { "comment_text": "", "digests": { "md5": "8aa42ca571a6b42ca1423895976e1339", "sha256": "8321878e2aced53e02dd44cb56a08f31fc9cba2d54aeacf9528952ce4c4b29b5" }, "downloads": -1, "filename": "django-smart-save-0.0.11.tar.gz", "has_sig": false, "md5_digest": "8aa42ca571a6b42ca1423895976e1339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2389, "upload_time": "2015-06-19T02:29:36", "url": "https://files.pythonhosted.org/packages/6a/61/65d3e655d15ed8d47266d4c6fb702b48b6aae8c643b651e6df81a9a80e0b/django-smart-save-0.0.11.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8aa42ca571a6b42ca1423895976e1339", "sha256": "8321878e2aced53e02dd44cb56a08f31fc9cba2d54aeacf9528952ce4c4b29b5" }, "downloads": -1, "filename": "django-smart-save-0.0.11.tar.gz", "has_sig": false, "md5_digest": "8aa42ca571a6b42ca1423895976e1339", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2389, "upload_time": "2015-06-19T02:29:36", "url": "https://files.pythonhosted.org/packages/6a/61/65d3e655d15ed8d47266d4c6fb702b48b6aae8c643b651e6df81a9a80e0b/django-smart-save-0.0.11.tar.gz" } ] }