{ "info": { "author": "Fran Hrzenjak", "author_email": "fran@changeset.hr", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: Freeware", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Normalized FileField\n====================\n\nFile field that behaves as close to other fields as possible.\n\nv. 0.1.1\n\nWhaat?\n------\n\nThis!\n\n.. figure:: docs/img/demo.gif\n :alt: Screenshots\n\n Screenshots\n\n(animated gif)\n\nWhaaaaat?! I don get it!\n------------------------\n\nBasic idea: I want to handle file inputs *no differently* from other\ninputs!\n\n- If a text input can have its value \"sent back\" when form validation\n fails, so must the file input!\n- Even when a file field is required, user should still be able to\n clear it (just as they can delete text in a required text field) no\n matter that the field validation will fail!\n\nFile inputs in HTML are a bit different that other inputs (\"text\",\n\"checkbox\", etc). Amount of data involved in a typical \"file\" field is\nmuch larger then what is in fields on any other type. It is one thing to\nsend and return (in the case of form validation error) a few characters\nin a text input, another thing completely to send and return megabytes\nof data in files - it's not practical.\n\nOn the server side this means that files have to be handled differently\nas well. Usually they are saved in a temporary place and it is up to the\ndeveloper to copy them where needed.\n\nDjango hides some of this boilerplate away, making working with file\nfields a bit simpler. But still it is different from other fields. As\nthis package demonstrates, there is no real need for this, as file\nfields can be made to behave like other fields.\n\nThis package normalizes the behaviour of file fields by extending\n``django.forms.fields.FileField`` and altering its behaviour to be as\nclose to other input types as possible.\n\nIt is meant to be a drop-in replacement for\n``django.forms.fields.FileField`` though some considerations are needed.\n\nVersions\n--------\n\nTestes in all combinations of:\n\n+----------+----------+\n| Django | Python |\n+==========+==========+\n| 1.7.11 | 2.7.10 |\n+----------+----------+\n| 1.8.8 | 3.4.3 |\n+----------+----------+\n| 1.9.1 | 3.5.1 |\n+----------+----------+\n\nDifferences from FileField\n--------------------------\n\n- TODO expand this section with details\n\nNot much... The \"Clear\" checkbox is present in some situations where the\n``ClearableFileInput`` does not render it.\n\nAlso, there is a new state for the field. In addition to \"empty\" and\n\"initial\" that traditional ``ClearableFileInput`` renders as a single\nHTML input element or as a double input with the link and label\n\"Currently\", this widget also has a \"Selected\" state. This is similar to\nstate with the \"Currently\" link, but it renders just the name of the\nfile without the link. It is used in situations when form validation has\nfailed, but the file field is ok and the file has been saved to\ntemporary storage (cache).\n\nUsage\n-----\n\nIn Models\n~~~~~~~~~\n\nA model field is provided to make use with models simpler. The only\ndifference from the normal ``models.field.FileField`` is that it\nspecifies a different form field class, namely ``NormalizedFileField``.\n\n::\n\n from normalized_filefield.model_field import NormalizedFileField\n\n class MyModel(models.Model):\n a_file = NormalizedFileField(upload_to='media/place')\n ...\n\nNote: In keeping with (dubious) tradition of how field classes are named\nin Django (``forms.field.FileField`` vs ``models.fields.FileField``),\nthis package also names form and model field the same,\n``NormalizedFileField``.\n\nIn Forms\n~~~~~~~~\n\n::\n\n from normalized_filefield.form_field import NormalizedFileField\n\n class MyModelForm(forms.ModelForm):\n a_file = NormalizedFileField()\n\nWidget ``normalized_filefield.widget.NormalizedFileInput`` is only meant\nto be used together with this form field class.\n\nChanging the markup\n~~~~~~~~~~~~~~~~~~~\n\nThe widget markup can be changed. Nothing different here then what\nregular ``ClearableFileInput`` provides. One difference is that template\nstrings are made with the \"format\" syntax instead of the old \"percent\"\nsyntax.\n\nSee ``normalized_filefield.widget.VerboseHTMLMixin`` for a very verbose\nmarkup option.\n\n- TODO expand this section\n\nTODO\n----\n\n- [ ] File cache storage seems not to clear automatically,\n- [ ] Styleable version, JS\n- [ ] Image Field\n- [ ] Clean up the widget and form classes (make more mixin-friendly\n structure)", "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/frnhr/django-normalized-filefield/", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-normalized-filefield", "package_url": "https://pypi.org/project/django-normalized-filefield/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-normalized-filefield/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/frnhr/django-normalized-filefield/" }, "release_url": "https://pypi.org/project/django-normalized-filefield/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Normalized file filed for Django", "version": "0.1.1" }, "last_serial": 1921076, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "42b9a8df6bd8090f33796034c7293a0e", "sha256": "192f1acc578fb527ac86d0ee182709f3b1340ac4b68d5a02ec59ae0127d78144" }, "downloads": -1, "filename": "django-normalized-filefield-0.1.0.tar.gz", "has_sig": false, "md5_digest": "42b9a8df6bd8090f33796034c7293a0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7967, "upload_time": "2016-01-25T03:19:32", "url": "https://files.pythonhosted.org/packages/b5/1c/8a6aeafd1753a41c8567764005b1c2246676e84b7962a3ca755c84ea8de4/django-normalized-filefield-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "dd6d7e8d3d0f5d5fe95105536f3a0bc8", "sha256": "3ee320a89f20b6975f566d02249f8fce1e45535305aa4f3f0ddbb8547739c40b" }, "downloads": -1, "filename": "django-normalized-filefield-0.1.1.tar.gz", "has_sig": false, "md5_digest": "dd6d7e8d3d0f5d5fe95105536f3a0bc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8970, "upload_time": "2016-01-25T03:33:36", "url": "https://files.pythonhosted.org/packages/47/de/64cd9a479d0dd84ec74ff88cdd59f6dccfafa9cf569c4e01a73b002a2cc0/django-normalized-filefield-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd6d7e8d3d0f5d5fe95105536f3a0bc8", "sha256": "3ee320a89f20b6975f566d02249f8fce1e45535305aa4f3f0ddbb8547739c40b" }, "downloads": -1, "filename": "django-normalized-filefield-0.1.1.tar.gz", "has_sig": false, "md5_digest": "dd6d7e8d3d0f5d5fe95105536f3a0bc8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8970, "upload_time": "2016-01-25T03:33:36", "url": "https://files.pythonhosted.org/packages/47/de/64cd9a479d0dd84ec74ff88cdd59f6dccfafa9cf569c4e01a73b002a2cc0/django-normalized-filefield-0.1.1.tar.gz" } ] }