{ "info": { "author": "Jes\u00fas Del Carpio", "author_email": "jjdelc@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "sorl-defined-thumbnails\n=======================\n\nThis is a plugin over standard sorl-thumbnails that constrains your thumbnail creation to only a set of pre defined sizes.\n\nDefine your thumbnail sizes in your settings:\n\n SORL_DEFINED_THUMBNAILS = {\n 'small_cropped': {\n 'size': (50, 50),\n 'options': {\n 'crop': 'center'\n }\n },\n 'small': {\n 'size': (50, 50),\n },\n 'medium': {\n 'size': (350, 350),\n },\n 'medium_cropped': {\n 'size': (350, 350),\n 'options': {\n 'crop': 'center'\n }\n },\n }\n\n\nAdd to your `INSTALLED_APPS` **before** `sorl.thumbnail`\n\n INSTALLED_APPS = (\n 'defined_thumbnails',\n 'sorl.thumbnail',\n )\n\nThis is important so the `{% thumbnail %}` template tag gets overriden by the new one.\n\nUsage\n-----\n\nThis app provides two template tags `{% dthumbnail %}` and overrides the standard `{% thumbnail %}` so it now takes the named thumbnails instead of arbitrary arguments.\n\nIn your templates now do:\n\n {% load thumbnail %}\n\n {% block content %}\n {% thumbnail object.pic_field \"medium\" as thumb %}\n \n {% endthumbnail %}\n\n {% endblock %}\n\nYou can also keep using the standard syntax:\n\n {% thumbnail object.pic_field \"350x350\" crop=\"center \"as thumb %}\n\nas long as the parameters entered match any of the defined sizes.\n\nWhen using strict mode the template tags will raise a syntax error if the parameters don't match the named thumbnails, otherwise they will only get logged.\n\nAlternatively you can use the `{% dthumbnail %}` tag which works like the overriden `{% thumbnail %}` tag but will always be strict. This tag also takes `{% empty %}` and closes with `{% endthumbnail %}`.\n\nMigration\n---------\n\nBy default, the new template tag will allow you to continue using old geometries not defined in `SORL_DEFINED_THUMBNAILS`.\nIf you want to raise errors with this, set `SORL_DEFINED_STRICT` to `True`.\n\nFinding all template occurences\n-------------------------------\n\n ./manage.py thumbnail_tags find_bad\n\nWill show all the occurences of the `{% thumbnail %}` tag in your templates.\n\n\nFinding all templates to convert\n--------------------------------\n\nThis app comes with a management command that will look in all app dirs and template dirs for matches of the thumbnail tag.\n\n ./manage.py thumbnail_tags find_bad\n\nIt will print all usages of the `{% thumbnail %}` tag in your templates\n\n\nSuggest which sizes to define\n-----------------------------\n\n ./manage.py thumbnail_tags suggest_sizes\n\nWill run a tally of all the `{% thumbnail %}` tags found in your templates and show you the occurences for each combination of geometry/options.\n\nThis should help you find which sizes to create in order to make the least changes in your templates.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jjdelc/sorl-defined-thumbnails/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jjdelc/sorl-defined-thumbnails", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "sorl-defined-thumbnail", "package_url": "https://pypi.org/project/sorl-defined-thumbnail/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sorl-defined-thumbnail/", "project_urls": { "Download": "https://github.com/jjdelc/sorl-defined-thumbnails/archive/master.zip", "Homepage": "https://github.com/jjdelc/sorl-defined-thumbnails" }, "release_url": "https://pypi.org/project/sorl-defined-thumbnail/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "A sorl-thumbnail extension to restrict the thumbnailgeneration to a pre defined set of values", "version": "0.0.1" }, "last_serial": 506191, "releases": { "0.0.1": [] }, "urls": [] }