{ "info": { "author": "Vladislav Lozhechnik", "author_email": "lozhechnik.vladislav@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "#DJANGO-RELINKING\n\nDjango-relinking application adds function and template filter for relinking custom text.\n\n\nInstallation\n------------------------\n1. Run from command line \"pip install django-relinking\"\n2. Add \"django_relinking\" to INSTALLED_APPS in your settings package\n3. Run migrations: ``` python manage.py migrate django_relinking ```\n\nOptions\n------------------------\n_If you want you can redefine next options:_\n+ __RELINKING_LINK_TEMPLATE__ - template for link tag.\n*Default*: ```RELINKING_LINK_TEMPLATE = '{text}'```\n+ __RELINKING_ENABLE_CACHE__ - enable or disable caching.\n*Default*: ```RELINKING_ENABLE_CACHE = False```\n+ __RELINKING_CACHE_PREFIX__ - prefix for keys in cache.\n*Default*: ```RELINKING_CACHE_PREFIX = \"{links_table}.{hash}\"```\n+ __RELINKING_INDEX_PATTERN__ - temporary pattern for replacting keys to link indexes.\n*Default*: ```RELINKING_INDEX_PATTERN = \"<%=link {}=%>\"```\n\nUsage\n------------------------\n*Before usage you must register models or other objects which have ```get_absolute_url``` method:*\n```python\nfrom django_relinking.content_types import register\n\n\"\"\"\ncontent_type - class of model or view which has method 'get_absolute_url`\n\nverbose_name - human title of content type.\n--- verbose_name can be a function. Default is None.\n--- If verbose_name is None and content_type has attribute 'verbose_name',\n------ then verbose_name = content_type.verbose_name\n--- If verbose_name is None and content_type has method 'verbose_name',\n------ then verbose_name = content_type.verbose_name()\n--- If verbose_name is None and content_type hasn't attribute 'verbose_name'\n------ then verbose_name = content_type.__name__\n\nobjects - queryset or list of this content_type objects.\n--- For example: ``` Model.objects.all() ```.\n--- Every objects must have attribute pk and `get_absolute_url` method\n--- If objects is None - this content type is a single\n--- and it must have `get_absolute_url` method\n\"\"\"\nregister(content_type, verbose_name, objects)\n```\n\n*Also you can:*\n```python\nfrom django_relinking.content_types import register_all, unregister, unregister_all\n#\n# Register many content types for one time\nregister_all(content_type1, content_type2, ..., content_typeN)\n#\n# Unregister registered content type\nunregister(content_type)\n#\n# Unregister all registered content types\nunregister_all()\n#\n# Unregister some registered content types\nunregister_all(content_type1, content_type2, ..., content_typeN)\n```\n____________________________________________________\nWhen you register appropriate content types you can:\n____________________________________________________\n**In template:**\n```html\n{% load relinking %}\n\n{% filter relink %}\n plain text\n{% endfilter %}\n\n{{ model.attr|relink }}\n```\n**In code:**\n```python\nfrom django_relinking import relink_text\nrelinked = relink_text(some_text_with_keywords)\n```", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://django-relinking.beslave.net/", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "django-relinking", "package_url": "https://pypi.org/project/django-relinking/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-relinking/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://django-relinking.beslave.net/" }, "release_url": "https://pypi.org/project/django-relinking/0.0.2/", "requires_dist": null, "requires_python": null, "summary": "Provide relinking features.", "version": "0.0.2" }, "last_serial": 880138, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fe8d8faa76dd9ff66f4e739b87446db8", "sha256": "bef93df4d3d246d0578c96f63456568c6f74c53803405e243d5c31b3b14820b1" }, "downloads": -1, "filename": "django-relinking-0.0.1.tar.gz", "has_sig": false, "md5_digest": "fe8d8faa76dd9ff66f4e739b87446db8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8122, "upload_time": "2013-09-25T08:15:23", "url": "https://files.pythonhosted.org/packages/85/27/999a2f96ef51111fb47333c5758c39454a96df795189f1d840bb5e2a5c05/django-relinking-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "4df900ced332a1bbf7c644c3cd486cbc", "sha256": "e0276fba110568f340595f6d9a5c66ffe1e1573066ff76e65019d590cf54190f" }, "downloads": -1, "filename": "django-relinking-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4df900ced332a1bbf7c644c3cd486cbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8304, "upload_time": "2013-10-03T13:50:56", "url": "https://files.pythonhosted.org/packages/b6/93/d20339e807b217f2d205c3c8f72d44c32d3fe7e244e4ab42d83199fb7c9a/django-relinking-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4df900ced332a1bbf7c644c3cd486cbc", "sha256": "e0276fba110568f340595f6d9a5c66ffe1e1573066ff76e65019d590cf54190f" }, "downloads": -1, "filename": "django-relinking-0.0.2.tar.gz", "has_sig": false, "md5_digest": "4df900ced332a1bbf7c644c3cd486cbc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8304, "upload_time": "2013-10-03T13:50:56", "url": "https://files.pythonhosted.org/packages/b6/93/d20339e807b217f2d205c3c8f72d44c32d3fe7e244e4ab42d83199fb7c9a/django-relinking-0.0.2.tar.gz" } ] }