{ "info": { "author": "Vasek Dohnal", "author_email": "vaclav.dohnal@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "==================\nDjango Upload Path\n==================\n\n.. image:: https://img.shields.io/pypi/v/django-upload-path.svg\n :target: https://pypi.python.org/pypi/django-upload-path\n :alt: PyPi\n\n.. image:: https://img.shields.io/badge/license-MIT-blue.svg\n :target: https://pypi.python.org/pypi/django-upload-path/\n :alt: MIT\n\n.. image:: https://img.shields.io/travis/illagrenan/django-upload-path.svg\n :target: https://travis-ci.org/illagrenan/django-upload-path\n :alt: TravisCI\n\n.. image:: https://img.shields.io/coveralls/illagrenan/django-upload-path.svg\n :target: https://coveralls.io/github/illagrenan/django-upload-path?branch=master\n :alt: Coverage\n\n.. image:: https://img.shields.io/pypi/implementation/django-upload-path.svg\n :target: https://pypi.python.org/pypi/django_brotli/\n :alt: Supported Python implementations\n\n.. image:: https://img.shields.io/pypi/pyversions/django-upload-path.svg\n :target: https://pypi.python.org/pypi/django_brotli/\n :alt: Supported Python versions\n\nIntroduction\n------------\n\nThis application provides various implementations for the ``FileField/ImageField.upload_to`` attribute (`https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to `_) (``upload_to`` attribute accepts callable).\n\nThese implementations are:\n\n- ``auto_cleaned_path`` will generate ``{MODEL_NAME}/{SAFE_UPLOADED_FILENAME}{SUFFIX}``\n- ``auto_cleaned_path_uuid4`` will generate ``{MODEL_NAME}/{SAFE_UPLOADED_FILENAME}{SEPARATOR}{UUID4}{SUFFIX}``\n- ``auto_cleaned_path_stripped_uuid4`` will generate ``{MODEL_NAME}/{UUID4}{SUFFIX}``\n\n\nExample\n=======\n\nFor example, how ``auto_cleaned_path`` works: First, the original file name (typically from the user) is always cleaned (using ``django.utils.text.slugify``). Then, a new path is generated that contains the model name.\n\nIf you have a ``MyModel`` model and the user uploads a ``foo-bar.txt`` file, the resulting path will be ``mymodel/foo-bar.txt``.\n\n.. code:: python\n\n from django.db import models\n from django_upload_path import auto_cleaned_path\n\n\n class MyModel(models.Model):\n file = models.FileField(upload_to=auto_cleaned_path)\n\n\nInstallation\n------------\n\n- Supported Python versions are: ``3.4.``, ``3.5``, ``3.6`` and ``3.7-dev``.\n- Supported Django versions are: ``1.8.x`` (LTS), ``1.9.x``, ``1.10.x`` and ``1.11.x`` (LTS).\n\n.. code:: shell\n\n pip install django-upload-path\n\n**Do not** add the app to ``INSTALLED_APPS`` (it is useless).\n\nUsage\n-----\n\n.. code:: python\n\n from django.db import models\n from django_upload_path.upload_path import auto_cleaned_path, auto_cleaned_path_stripped_uuid4, auto_cleaned_path_uuid4\n\n\n class MyModel(models.Model):\n file1 = models.FileField(upload_to=auto_cleaned_path)\n file2 = models.FileField(upload_to=auto_cleaned_path_stripped_uuid4)\n file3 = models.FileField(upload_to=auto_cleaned_path_uuid4)\n\n\nNote: ``ImageField`` (`https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ImageField `_) is also supported.\n\n\nLicense\n-------\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Va\u0161ek Dohnal (@illagrenan)\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/illagrenan/django-upload-path", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-upload-path", "package_url": "https://pypi.org/project/django-upload-path/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-upload-path/", "project_urls": { "Homepage": "https://github.com/illagrenan/django-upload-path" }, "release_url": "https://pypi.org/project/django-upload-path/0.1.1/", "requires_dist": [ "django", "typing; python_version<'3.5'" ], "requires_python": "~=3.4", "summary": "Various implementations for the Django ``FileField/ImageField.upload_to`` model field attribute.", "version": "0.1.1" }, "last_serial": 2996627, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "03fa88644eed5ba1e40d8aea5f2db83f", "sha256": "d1f0ecca8a50f0224006b41229630246b504fda3e7f0028f78b2059089db2bc8" }, "downloads": -1, "filename": "django_upload_path-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "03fa88644eed5ba1e40d8aea5f2db83f", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 5958, "upload_time": "2017-06-27T14:37:11", "url": "https://files.pythonhosted.org/packages/38/2b/4d6a1bebbf652faf194915c9b5951e2fefed3b21bdc2cd436636d0acf5ca/django_upload_path-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a6e5899e790b9bcef468fb0ba601497f", "sha256": "404a0321822500b96868cfcae505adbd34f47e74c3d9429e8a77844611acfde6" }, "downloads": -1, "filename": "django-upload-path-0.1.0.tar.gz", "has_sig": false, "md5_digest": "a6e5899e790b9bcef468fb0ba601497f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3828, "upload_time": "2017-06-27T14:37:07", "url": "https://files.pythonhosted.org/packages/50/3a/927ac7c9565c04c25c5db3c09ebab1131df2200bffd50a4aa44a98625731/django-upload-path-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b61a458d168ac4a5a8b2ef2ea783f742", "sha256": "1ed79e7896e75af2ba37a03f6d921612e58aa8cf4cf20565824ea1084cfc69ca" }, "downloads": -1, "filename": "django_upload_path-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b61a458d168ac4a5a8b2ef2ea783f742", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": "~=3.4", "size": 7138, "upload_time": "2017-07-03T12:34:41", "url": "https://files.pythonhosted.org/packages/ff/0d/a8e4ae79900b61a89d724cafb5fef8da2cc35b9303dd7c106717a7844627/django_upload_path-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5155ab28882c7eb53690b0ac7b16b5ec", "sha256": "ec4281f78889ce9295251670931987c9db59de72485b14f3fde64391de76bfd6" }, "downloads": -1, "filename": "django-upload-path-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5155ab28882c7eb53690b0ac7b16b5ec", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 4438, "upload_time": "2017-07-03T12:34:43", "url": "https://files.pythonhosted.org/packages/54/e6/ada9d82dfa2a02d7120f153abc240c878fe428dd834d897dddb15b0ee8ed/django-upload-path-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b61a458d168ac4a5a8b2ef2ea783f742", "sha256": "1ed79e7896e75af2ba37a03f6d921612e58aa8cf4cf20565824ea1084cfc69ca" }, "downloads": -1, "filename": "django_upload_path-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b61a458d168ac4a5a8b2ef2ea783f742", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": "~=3.4", "size": 7138, "upload_time": "2017-07-03T12:34:41", "url": "https://files.pythonhosted.org/packages/ff/0d/a8e4ae79900b61a89d724cafb5fef8da2cc35b9303dd7c106717a7844627/django_upload_path-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5155ab28882c7eb53690b0ac7b16b5ec", "sha256": "ec4281f78889ce9295251670931987c9db59de72485b14f3fde64391de76bfd6" }, "downloads": -1, "filename": "django-upload-path-0.1.1.tar.gz", "has_sig": false, "md5_digest": "5155ab28882c7eb53690b0ac7b16b5ec", "packagetype": "sdist", "python_version": "source", "requires_python": "~=3.4", "size": 4438, "upload_time": "2017-07-03T12:34:43", "url": "https://files.pythonhosted.org/packages/54/e6/ada9d82dfa2a02d7120f153abc240c878fe428dd834d897dddb15b0ee8ed/django-upload-path-0.1.1.tar.gz" } ] }