{ "info": { "author": "Nothrbridge Development Konrad & Schneider GbR", "author_email": "mail@nb-dev.de", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "|PyPI version| |Build Status| |Coverage Status| |Downloads| |Supported\nPython versions| |Supported Django versions| |License| |Codacy Badge|\n\ndjango-appregistration\n======================\n\nThis app provides a base class to easily realize django apps that allow\nother apps to register parts in it.\n\nRequirements:\n-------------\n\n- Django >= 1.6\n\nInstallation\n------------\n\n- From the pip repository: ``pip install django-appregistration``\n- or directly from github:\n ``pip install git+git://github.com/NB-Dev/django-apregistration.git``\n\nUsage\n-----\n\ndjango-appregistration provides two base classes for the registration of\nmodules from other apps: ``MultiListPartRegistry`` and\n``SingleListPartRegistry``. While both have the same basic\nfunctionality, in the ``MultiListPartRegistry`` multiple distinct lists\nof objects can be collected, the ``SingleListPartRegistry`` only\ncontains a single list.\n\nTo implement a ``...PartRegistry`` in your app, create a subclass of the\n``...PartRegistry`` or your choice in a convenient place in your\napplication. There are some attributes you can overwrite in your\nSubclass:\n\n- ``part_class`` (required): The (parent) class of the objects that are\n allowed to be inserted into your Registry\n\n- ``call_function_subpath`` (required): The subpath to the function\n that is to be called by the registry on load (details, see below)\n\n- ``ignore_django_namespace``\\ (default: True): If true, any app that\n starts with ``django.`` in your ``INSTALLED_APPS`` will be ignored on\n load time.\n\nTo prevent arbitrary items to be inserted into your Registry the\n``...PartRegistry`` classes check each added element to be an instance\nof the class that is set as the ``part_class`` attribute of the your\nRegistry.\n\nWhen the Registry tries to load elements from the ``INSTALLED_APPS``, it\niterates over the apps and tries, for each to get the sub module /\nfunction that is defined in the ``call_function_subpath``. It then\nchecks if the retrieved object is callable and calls it if so passing\nthe Registry itself as only call parameter.\n\nTo register elements with the Registry you therefore need to implement\nthe appropriate function at ``call_function_subpath`` in an app that is\nlisted in the ``INSTALLED_APPS``. The implemented function then needs to\ncall the ``add_item`` function on the passed registry.\n\nTo further simplify the usage of dynamic apps, the app provides a\n``filter_available_apps`` function that filters a list of possible apps\nand returns only the ones that are available in the current\ninstallation. This allows for a highly dynamic configuration of django\nprojects by allowing certain apps to be installed selectively. Use it in\nyour ``settings.py`` to dynamically add the available apps to your\n``INSTALLED_APPS``\n\nFile: settings.py\n~~~~~~~~~~~~~~~~~\n\n::\n\n from django_appregistration import filter_available_apps\n INSTALLED_APPS = [\n 'imported_app1',\n 'imported_app2',\n 'imported_app3',\n ...\n ] + filter_available_apps(\n 'optional_app1',\n 'optional_app2',\n 'optional_app3',\n ...\n )\n\nExample\n-------\n\nHere is an implementation example with a Registry implemented in the\n``extendable_app`` app and an app ``extending_app`` that extends the\nRegistry\n\nFile: extendable\\_app.registry.py\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n from django_appregistration import MultiListPartRegistry\n\n class MyRegisterable(object):\n pass\n\n class MyRegistry(MultiListPartRegistry):\n part_class = MyRegisterable\n call_function_subpath = 'registerable.register'\n\nFile: extending\\_app.registerable.py\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n def register(registry):\n # import inside the function so that the import is only needed if the registry is used\n # and the package is therefore available\n from extendable_app.registry import MyRegisterable\n \n registry.add_part('default', MyRegisterable())\n registry.add_part('other', MyRegisterable())\n\nLike this the ``extending_app`` registers two parts when the registry is\nloaded, one in the list ``default`` and one in the list ``other``.\n\nThe objects can be retrieved like so:\n\n::\n\n from extendable_app.registry import MyRegistry\n default_parts = MyRegistry.get('default') # retrieves the `default` list\n other_parts = MyRegistry.get('other') # retrieves the `other` list\n\nAPI\n---\n\nAPI documetation\n\nMultiListPartRegistry(object)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following functions are available:\n\nadd\\_part(list, part)\n^^^^^^^^^^^^^^^^^^^^^\n\nAdds the part given by the ``part`` parameter to the list with the name\ngiven by the ``list`` parameter.\n\nget(list)\n^^^^^^^^^\n\nReturns the parts in the list with the name given by the ``list``\nparameter. The elements are sorted before they are returned.\n\nsort\\_parts(parts)\n^^^^^^^^^^^^^^^^^^\n\nCan be overwritten to define a custom ordering of the parts. The default\nfunction simply returns the list unordered.\n\nload()\n^^^^^^\n\nWhen called, the class is initialized and loads the available parts into\nits list cache. Does nothing if the ``load()`` was already called. Is\ncalled automatically by the ``get()`` function. There is no need to call\nit explicitly unless you want to initialize the class before the first\nlist is retrieved.\n\nreset()\n^^^^^^^\n\nResets the Registry to its initial state so that the parts will be\nreloaded the next time the ``load()`` function is called. Usually there\nis no need to call this as it only adds extra overhead when the parts\nneed to be loaded again.\n\nSingleListPartRegistry(MultiListPartRegistry)\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe following functions are additionally available:\n\nadd\\_part(part)\n^^^^^^^^^^^^^^^\n\nAdds the part given by the ``part`` parameter to the list.\n\nget()\n^^^^^\n\nReturns the parts in the list. The elements are sorted before they are\nreturned.\n\nRunning the tests\n-----------------\n\nThe included tests can be run standalone by running the\n``tests/runtests.py`` script. You need to have Django and mock installed\nfor them to run. If you also want to run coverage, you need to install\nit before running the tests\n\nChangelog\n---------\n\nv0.0.6 (2017-05-19)\n~~~~~~~~~~~~~~~~~~~\n\n- Fixing README heading levels\n\nv0.0.5 (2017-05-19)\n~~~~~~~~~~~~~~~~~~~\n\n- Adding support for Django 1.10 and 1.11\n\nv.0.0.4\n~~~~~~~\n\n- Adding the ``filter_available_apps`` function that checks a list of\n given apps for their availability.\n\nv.0.0.3\n~~~~~~~\n\n- Bugfix: Also moved the ``lock`` and the ``loaded`` attributes into\n the meta class\n\nv.0.0.2\n~~~~~~~\n\n- Bugfix: Using a metaclass to separate the lists for each subclass of\n ``MultiListPartRegistry``. Before each registry used the same list\n resulting in element mixtures if more than one registry was used\n\nv.0.0.1a\n~~~~~~~~\n\n- Rename ``Type`` to ``List`` in classes\n\nv.0.0.1\n~~~~~~~\n\n- Initial implementation of ``MultiTypePartRegistry`` and\n ``SingleTypePartRegistry``\n\nMaintainers\n-----------\n\nThis Project is maintained by `Northbridge Development Konrad &\nSchneider GbR `__\nSoftwareentwicklung.\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/django-appregistration.svg\n :target: http://badge.fury.io/py/django-appregistration\n.. |Build Status| image:: https://travis-ci.org/NB-Dev/django-appregistration.svg?branch=master\n :target: https://travis-ci.org/NB-Dev/django-appregistration\n.. |Coverage Status| image:: https://coveralls.io/repos/NB-Dev/django-appregistration/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/NB-Dev/django-appregistration?branch=master\n.. |Downloads| image:: https://img.shields.io/pypi/dm/django-appregistration.svg\n :target: https://pypi.python.org/pypi/django-appregistration/\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/django-appregistration.svg\n :target: https://pypi.python.org/pypi/django-appregistration/\n.. |Supported Django versions| image:: https://img.shields.io/badge/Django-1.6%2C%201.7%2C%201.8%2C%201.9%2C%201.10%2C%201.11-brightgreen.svg\n :target: https://pypi.python.org/pypi/django-pluggableappsettings/\n.. |License| image:: https://img.shields.io/pypi/l/django-appregistration.svg\n :target: https://pypi.python.org/pypi/django-appregistration/\n.. |Codacy Badge| image:: https://api.codacy.com/project/badge/grade/e9e55c2658d54801b6b29a1f52173dcf\n :target: https://www.codacy.com/app/tim_11/django-appregistation", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/NB-Dev/django-appregistration", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-appregistration", "package_url": "https://pypi.org/project/django-appregistration/", "platform": "", "project_url": "https://pypi.org/project/django-appregistration/", "project_urls": { "Homepage": "http://github.com/NB-Dev/django-appregistration" }, "release_url": "https://pypi.org/project/django-appregistration/0.0.6/", "requires_dist": null, "requires_python": "", "summary": "Dynamic registration between django apps.", "version": "0.0.6" }, "last_serial": 2885301, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "636da5e4d15b601a43a67edf405f115f", "sha256": "c7a36b89a997f3029e77e645828067562218fc2aa301eb61e594e14e3c840f8b" }, "downloads": -1, "filename": "django-appregistration-0.0.1.tar.gz", "has_sig": false, "md5_digest": "636da5e4d15b601a43a67edf405f115f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3949, "upload_time": "2016-01-20T12:41:25", "url": "https://files.pythonhosted.org/packages/eb/19/4c370ba1ca2fda9f1df412df7bffed2a21f931cccc73ba312a9140c7cd40/django-appregistration-0.0.1.tar.gz" } ], "0.0.1a0": [ { "comment_text": "", "digests": { "md5": "5167844ed0e065380b70606b209673b6", "sha256": "4db53a77cae187687efa7b49ab0a84292451351451858346c94b91c2b3ff9197" }, "downloads": -1, "filename": "django-appregistration-0.0.1a0.tar.gz", "has_sig": false, "md5_digest": "5167844ed0e065380b70606b209673b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5954, "upload_time": "2016-01-20T13:28:01", "url": "https://files.pythonhosted.org/packages/95/0c/d33858aee42806557f6a7ceb5ef14628f336757c0c116c455a200980a1da/django-appregistration-0.0.1a0.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "f1fa57560a3ae24edd7fb2cee85fac5e", "sha256": "31a5b986750542ecc0ffba609b90d4bb261a8cbb41de0715b59a02e6eb7d4752" }, "downloads": -1, "filename": "django_appregistration-0.0.2-py2.7.egg", "has_sig": false, "md5_digest": "f1fa57560a3ae24edd7fb2cee85fac5e", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 6778, "upload_time": "2017-05-19T10:25:12", "url": "https://files.pythonhosted.org/packages/8c/85/bb0d8972b3ba859f80bfad5343a29ef77745eddb9d53c4f14ae7ee73c874/django_appregistration-0.0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "7a5783de2eba78ff6524ff94784e6de1", "sha256": "88f01df14553f84e256c62fa9b78b8370eacfc15bcc381487da21ffc697cc53c" }, "downloads": -1, "filename": "django-appregistration-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7a5783de2eba78ff6524ff94784e6de1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6119, "upload_time": "2016-01-27T08:20:52", "url": "https://files.pythonhosted.org/packages/06/90/85f20cb8f2014322c2a26180b9c71d03baf3d7b490d7622b0acc1ccb3cc2/django-appregistration-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1bd5293b3722991eef0d6255d26a9412", "sha256": "725df1c6825505f88030f1f7b412a1d1effde81a4dc92dc62386752345ce8c27" }, "downloads": -1, "filename": "django-appregistration-0.0.3.tar.gz", "has_sig": false, "md5_digest": "1bd5293b3722991eef0d6255d26a9412", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6127, "upload_time": "2016-01-28T13:30:40", "url": "https://files.pythonhosted.org/packages/bd/47/c69b1e70e4d8655cbdd20a15723eaef050f9971ff1fab19261263220a9ce/django-appregistration-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "9516de71203b9a016e775d3c9be31d32", "sha256": "01309aad5a58f19e32e70647c0e3733e15ef420e75b29b802daf620203debc3c" }, "downloads": -1, "filename": "django-appregistration-0.0.4.tar.gz", "has_sig": false, "md5_digest": "9516de71203b9a016e775d3c9be31d32", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6772, "upload_time": "2017-05-19T10:25:10", "url": "https://files.pythonhosted.org/packages/5b/38/02ca94b252e1beab8b0cdba31b27ca8e829d2b211125964a10c852e1f99b/django-appregistration-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "68bd89478949f57d4b72ae94cd136015", "sha256": "c9a1c5c273dcf0229b12c4b2e0833d1717dae4024549f2dfedfeb51c737f5b0b" }, "downloads": -1, "filename": "django-appregistration-0.0.5.tar.gz", "has_sig": false, "md5_digest": "68bd89478949f57d4b72ae94cd136015", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6855, "upload_time": "2017-05-19T10:27:45", "url": "https://files.pythonhosted.org/packages/bb/06/d6c4635abf456a26adb43e95e3dac65fc7992697415c8718903d28da0696/django-appregistration-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "9e4195dd2e2c4b4a60f1700bb7aed3c5", "sha256": "5aaa3e793d5834d8a405871c513dfc107fa52fd5e41b7d81456dc3b78186b677" }, "downloads": -1, "filename": "django-appregistration-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9e4195dd2e2c4b4a60f1700bb7aed3c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6959, "upload_time": "2017-05-19T10:41:02", "url": "https://files.pythonhosted.org/packages/08/0a/b902344855879558c9693019f9a1750a90a9f0be37abe0da2e2623405986/django-appregistration-0.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e4195dd2e2c4b4a60f1700bb7aed3c5", "sha256": "5aaa3e793d5834d8a405871c513dfc107fa52fd5e41b7d81456dc3b78186b677" }, "downloads": -1, "filename": "django-appregistration-0.0.6.tar.gz", "has_sig": false, "md5_digest": "9e4195dd2e2c4b4a60f1700bb7aed3c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6959, "upload_time": "2017-05-19T10:41:02", "url": "https://files.pythonhosted.org/packages/08/0a/b902344855879558c9693019f9a1750a90a9f0be37abe0da2e2623405986/django-appregistration-0.0.6.tar.gz" } ] }