{ "info": { "author": "Razi Alsayyed", "author_email": "razi.sayed@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Application Frameworks" ], "description": "Parler Tools\nextracts applicable methods from aldryn-translation-tools to be used without django-cms\n\n\nmodels.TranslatedAutoSlugMixin\n------------------------------\n\nThis is a TranslatableModel mixin that automatically generates a suitable\nslug for the object on ``save()``.\n\nIf ``slug_globally_unique`` is ``True``, then slugs will be required to be\nunique across all languages.\n\nIf ``slug_globally_unique`` is ``False`` (default), then the strategy used here\nis that it is OK for two objects to use the same slug if the slugs are for\ndifferent languages. So if this were used on a translated Article model, these\nURLs would be valid:\n\n``/en/pain`` - An article in EN about physical discomfort\n\n``/fr/pain`` - An article in FR about bread\n\nOf course, this means that when resolving an object from its URL, care must\nbe taken to factor in the language segment of the URL too.\n\nWhen using this mixin, it is important to also set the\n``slug_source_field_name`` property on the implementing model to the name of\nthe translated field which the slug is to be derived from. If you require more\nslugs to be derived from multiple fields (translated or otherwise), simply\noverride the method ``get_slug_source`` to provide the source string for the\nslug.\n\nConfiguration properties\n************************\n\nslug_default\n~~~~~~~~~~~~\nProvide a lazy translated string to use for the default slug should an object\nnot have a source string to derive a slug from.\n\nslug_field_name\n~~~~~~~~~~~~~~~\nProvide the name of the translated field in which generated slug shall\nbe stored.\n\nslug_globally_unique\n~~~~~~~~~~~~~~~~~~~~\nA boolean flag controlling whether slugs are globally unique, or only unique\nwith each language. Default value is False.\n\nslug_max_length\n~~~~~~~~~~~~~~~\nDeclares the max_length of slugs. This defaults to the ``max_length`` of the\nslug_field and is determined via introspection.\n\nslug_separator\n~~~~~~~~~~~~~~\nThis determines the separator used before any index added to the slug. It does\n**not** determine the separator used in the slug itself, which is always ``-``.\nThis is only provided for compatibility with the slugify()`` method in\naldryn_common, but it is not recommended to be used. Defaults to ``-``.\n\nslug_source_field_name\n~~~~~~~~~~~~~~~~~~~~~~\nProvide the name of the translated field to be used for deriving the slug.\nIf more than one field, or other complex sources are required, override the\nmethod ``get_slug_source()`` instead. Note that if ``get_slug_source()`` is\noverriden, it is recommended to also override ``get_slug_default()``.\n\n\nPublic methods\n**************\n\nget_slug_default\n~~~~~~~~~~~~~~~~\n\nNaively constructs a translated default slug from the object. For better\nresults, just set the `slug_default` property on the class to a lazy\ntranslated string. Alternatively, override this method if you need to more\nprogrammtically determine the default slug.\n\nExample: If your model is \"news article\" and your source field is \"title\" this\nwill return \"news-article-without-title\".\n\n\nget_slug_max_length\n~~~~~~~~~~~~~~~~~~~\nAccepts an optional parameter ``idx_len``.\n\nIntrospects the slug field to determine the maximum length, taking into account\na possible separator and up to a [idx_len]-digit number.\n\n\nget_slug_source\n~~~~~~~~~~~~~~~\nSimply returns the value of the slug source field. Override for more complex\nsituations such as using multiple fields (translated or not) as the source.\n\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/razisayyed/parler-tools", "keywords": null, "license": "LICENSE", "maintainer": null, "maintainer_email": null, "name": "django-parler-tools", "package_url": "https://pypi.org/project/django-parler-tools/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-parler-tools/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/razisayyed/parler-tools" }, "release_url": "https://pypi.org/project/django-parler-tools/0.5.0/", "requires_dist": null, "requires_python": null, "summary": "Collection of helpers and mixins for translated projects (extracted from aldryn-translation-tools)", "version": "0.5.0" }, "last_serial": 2311239, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "9670ecfb20bcf13257021e2b00d80c13", "sha256": "e6f5a05b242b9a440b903d63f8f4f5a6165f7fc1236b87f4ee3bc482de05e4d4" }, "downloads": -1, "filename": "django-parler-tools-0.5.0.tar.gz", "has_sig": false, "md5_digest": "9670ecfb20bcf13257021e2b00d80c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5814, "upload_time": "2016-08-29T14:47:33", "url": "https://files.pythonhosted.org/packages/c0/b3/da2aa8528598dbbcc3d5afd7a900411372d9ae0cfd081785d07580613ef4/django-parler-tools-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9670ecfb20bcf13257021e2b00d80c13", "sha256": "e6f5a05b242b9a440b903d63f8f4f5a6165f7fc1236b87f4ee3bc482de05e4d4" }, "downloads": -1, "filename": "django-parler-tools-0.5.0.tar.gz", "has_sig": false, "md5_digest": "9670ecfb20bcf13257021e2b00d80c13", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5814, "upload_time": "2016-08-29T14:47:33", "url": "https://files.pythonhosted.org/packages/c0/b3/da2aa8528598dbbcc3d5afd7a900411372d9ae0cfd081785d07580613ef4/django-parler-tools-0.5.0.tar.gz" } ] }