{ "info": { "author": "Axiacore", "author_email": "info@axiacore.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# AX3 Model Extras\n\n## Validate image size\n\nIf you want to validate the dimension and file size for images:\n\n```\nfrom ax3_model_extras.validators import FileSizeValidator, ImageDimensionValidator\n\n\nclass Post(models.Model):\n title = models.CharField()\n\n slug = models.SlugField()\n\n image = models.ImageField(\n validators=[ImageDimensionValidator([1920, 800]), FileSizeValidator(350)],\n help_text='JPG. 1920x800px. 350kb max.',\n )\n```\n\nIf you want to validate one dimension, you have to send the other dimension with 0\n\n```\nfrom ax3_model_extras.validators import FileSizeValidator, ImageDimensionValidator\n\n\nclass Post(models.Model):\n title = models.CharField()\n\n slug = models.SlugField()\n\n image = models.ImageField(\n validators=[ImageDimensionValidator([1920, 0]), FileSizeValidator(350)],\n help_text='JPG. width=1920px. 350kb max.',\n )\n```\n\n\n\n## Improve file storage\n\nIf you want to improve the local file storage or use S3 upload:\n\n```\nfrom ax3_model_extras.storages import get_storage, get_upload_path\n\n\nclass Post(models.Model):\n title = models.CharField()\n\n slug = models.SlugField()\n\n image = models.ImageField(\n upload_to=get_upload_path,\n storage=get_storage(),\n )\n```\n\n\n## Optimize images before upload them.\n\nUse as:\n\n```\nfrom ax3_model_extras.fields import OptimizedImageField\n\n\nclass Post(models.Model):\n title = models.CharField()\n\n slug = models.SlugField()\n\n image = OptimizedImageField()\n\n```\n\n\nIf want to set the size of the image using the 'cover' method do:\n\n```\nimage = OptimizedImageField(\n optimized_image_output_size=(1920, 800),\n)\n```\n\n\nIf want to set the size of the image using the 'thumbnail' method do:\n\n```\nimage = OptimizedImageField(\n optimized_image_output_size=(1920, 800),\n optimized_image_resize_method='thumbnail',\n)\n```\n\nResize is done using https://pypi.org/project/python-resize-image/\n\nMade by Axiacore.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Axiacore/ax3-model-extras", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "AX3-model-extras", "package_url": "https://pypi.org/project/AX3-model-extras/", "platform": "", "project_url": "https://pypi.org/project/AX3-model-extras/", "project_urls": { "Homepage": "https://github.com/Axiacore/ax3-model-extras" }, "release_url": "https://pypi.org/project/AX3-model-extras/1.0.3/", "requires_dist": [ "python-resize-image" ], "requires_python": "", "summary": "Extras for AX3 models", "version": "1.0.3" }, "last_serial": 5816361, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "eec5e63571f583a1ebfb195638cc6ef6", "sha256": "a223d1bc36e653bb5999e43e9cf78cf1aa57950a00abe5aab4da3f88c5910700" }, "downloads": -1, "filename": "AX3_model_extras-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "eec5e63571f583a1ebfb195638cc6ef6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4744, "upload_time": "2019-08-23T17:20:24", "url": "https://files.pythonhosted.org/packages/95/d1/39f92f3528f2797197ff5f8bfefd84e0e51c19f435777e6690cd9a415112/AX3_model_extras-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "adeaa921f53d370f7dc9137d764a88be", "sha256": "f848725d358fe0983a13cb73505865624ac786cfaf1cb1434a335ad679b008fa" }, "downloads": -1, "filename": "AX3 model extras-1.0.0.tar.gz", "has_sig": false, "md5_digest": "adeaa921f53d370f7dc9137d764a88be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3016, "upload_time": "2019-08-23T17:20:26", "url": "https://files.pythonhosted.org/packages/17/48/d924cb65d10acb2ecc07407c54f8877f5f23f3e1c599d0e0005547f1ca39/AX3%20model%20extras-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3aaadf85407c7b5d5b2d597a5ab3d844", "sha256": "0c3095e22df11ca38995f7c12245dcba20f3138ea0a2b3e8157ea6cc0fbce610" }, "downloads": -1, "filename": "AX3_model_extras-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3aaadf85407c7b5d5b2d597a5ab3d844", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4819, "upload_time": "2019-09-10T21:14:47", "url": "https://files.pythonhosted.org/packages/db/1f/c09df18ec9897b60677ed39b8a8fa30480812202d97184a02e994fc7e5ff/AX3_model_extras-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df3c8a7cd744874288252406c5f758f9", "sha256": "de7cdf515ea90ab05f145bc66e63ff4ba5e4f4d6d75d5db08db088eb0e1d7474" }, "downloads": -1, "filename": "AX3 model extras-1.0.2.tar.gz", "has_sig": false, "md5_digest": "df3c8a7cd744874288252406c5f758f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3089, "upload_time": "2019-09-10T21:14:48", "url": "https://files.pythonhosted.org/packages/74/09/bf8717767cdd03d3ba59d698ab112614fd2be9e3a29abfaf4f3d2b8c54f2/AX3%20model%20extras-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "77f791d788343f0291f31c91ba1bbf85", "sha256": "7fd008c6703e8a459359994d119d6ad9366b69aae38ca6382f0812320535847f" }, "downloads": -1, "filename": "AX3_model_extras-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "77f791d788343f0291f31c91ba1bbf85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4922, "upload_time": "2019-09-11T18:49:49", "url": "https://files.pythonhosted.org/packages/9b/01/aa30a69e83d4ee484536fc34a96e53020decb5a5f5e1addbdbf2b0ac0486/AX3_model_extras-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d900e028424cce1cf37b0a30809a0761", "sha256": "134abd1b076e8a7d4086ee1e43f291a33a2dcfc52d396c08f5392dfad1f8fb4b" }, "downloads": -1, "filename": "AX3 model extras-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d900e028424cce1cf37b0a30809a0761", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3184, "upload_time": "2019-09-11T18:49:50", "url": "https://files.pythonhosted.org/packages/70/37/38d72593a7f9e6c15a096f5bc5ef6436b7c440edaf020397f8c4de621136/AX3%20model%20extras-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "77f791d788343f0291f31c91ba1bbf85", "sha256": "7fd008c6703e8a459359994d119d6ad9366b69aae38ca6382f0812320535847f" }, "downloads": -1, "filename": "AX3_model_extras-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "77f791d788343f0291f31c91ba1bbf85", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4922, "upload_time": "2019-09-11T18:49:49", "url": "https://files.pythonhosted.org/packages/9b/01/aa30a69e83d4ee484536fc34a96e53020decb5a5f5e1addbdbf2b0ac0486/AX3_model_extras-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d900e028424cce1cf37b0a30809a0761", "sha256": "134abd1b076e8a7d4086ee1e43f291a33a2dcfc52d396c08f5392dfad1f8fb4b" }, "downloads": -1, "filename": "AX3 model extras-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d900e028424cce1cf37b0a30809a0761", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3184, "upload_time": "2019-09-11T18:49:50", "url": "https://files.pythonhosted.org/packages/70/37/38d72593a7f9e6c15a096f5bc5ef6436b7c440edaf020397f8c4de621136/AX3%20model%20extras-1.0.3.tar.gz" } ] }