{ "info": { "author": "michaelb", "author_email": "michaelpb@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "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" ], "description": "=============================\nDjango Actable\n=============================\n\n.. image:: https://badge.fury.io/py/actable.svg\n :target: https://badge.fury.io/py/actable\n\n.. image:: https://travis-ci.org/michaelpb/actable.svg?branch=master\n :target: https://travis-ci.org/michaelpb/actable\n\n.. image:: https://codecov.io/gh/michaelpb/actable/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/michaelpb/actable\n\n* **NOTE:** Presently *only* supports Python 3.5+ and Django 1.9+ (see `issue\n #1 `_)\n\nActivity stream for Python Django. Unlike other activity streams, it is much\nmore flexible, with every event designed to supporting an arbitrary number of\nassociated objects. It also is designed to be unobtrusive: Any of your models\ncan be registered as an activity generator, all you need to do is generate a\ndata structure for context, or an HTML fragment.\n\nFeatures\n--------\n\n- Very easily / magically integrated into an existing system, with signals\n being auto-generated based on principle objects\n- Arbitrary number of objects can be associated with every event\n- Fast look ups with denormalized events (no joins)\n- Looking up streams for particular actors or objects\n- Decent test coverage\n- Handy Paginator helper class to page through stream\n- Example project\n\n- **Not yet implemented:** Follow\n\n\nQuick start\n------------\n\n**Overview:**\n\n1. Install actable and put in requirements file\n\n2. Add to INSTALLED_APPS\n\n3. Pick several important models to implement the actable interface so that\nevery save or update generates an event\n\n4. Add those models to ACTABLE_MODELS\n\n5. Use helper classes to add a streams to your views\n\n---------------\n\nInstall:\n\n.. code-block:: bash\n\n pip install actable\n\n\nAdd it to your `INSTALLED_APPS`:\n\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'actable.apps.ActableConfig',\n ...\n )\n\nPick one or more models to be your actable models. Whenever these models are\nupdated or created, it will generate events. These events can involve any\nnumber of other objects.\n\nYou must implement at least 2 methods on your actable models. The first method\nis ``get_actable_relations`` which must return a dictionary where all the\nvalues are model instances that are related to this action. Instead of\nlimiting yourself to \"Actor, Verb, Object\", this allows you to have any number\nof relations. Each one of these model instances will receive a copy of this\nevent to its activity stream.\n\nExample:\n\n.. code-block:: python\n\n class ProjectBlogPost:\n def get_actable_relations(self, event):\n return {\n 'subject': self.user,\n 'object': self,\n 'project': self.project,\n }\n\nNow you must choose one of 2 other methods to implement. These constitute the\ndata to cache for each event.\n\nThe most versatile of the two is one that returns a dictionary containing\nentirely simple (serializable) data types. This will be stored in serialized\nform in your database.\n\nExample:\n\n.. code-block:: python\n\n class ProjectBlogPost:\n def get_actable_json(self, event):\n verb = 'posted' if event.is_creation else 'updated'\n return {\n 'subject': self.user.username,\n 'subject_url': self.user.get_absolute_url(),\n 'object': self.title,\n 'object_url': self.get_absolute_url(),\n 'project': self.project.title,\n 'verb': verb,\n }\n\n\nThe other option is caching an HTML snippet (string) that can be generated any\nway you see fit.\n\nExample:\n\n.. code-block:: python\n\n class ProjectBlogPost:\n def get_actable_html(self, event):\n return '%s wrote %s' % (\n self.user.get_absolute_url(),\n self.user.username,\n self.title\n )\n\nFinally, you should list your newly improved as an ``ACTABLE_MODEL``, as such:\n\n.. code-block:: python\n\n ACTABLE_MODELS = [\n 'myapp.ProjectBlogPost',\n ]\n\n\nCredits\n-------\n\nTools used in creating this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.1.0 (2017-11-10)\n++++++++++++++++++\n\n* First release on PyPI.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/michaelpb/actable", "keywords": "actable", "license": "Apache Software License 2.0", "maintainer": "", "maintainer_email": "", "name": "actable", "package_url": "https://pypi.org/project/actable/", "platform": "", "project_url": "https://pypi.org/project/actable/", "project_urls": { "Homepage": "https://github.com/michaelpb/actable" }, "release_url": "https://pypi.org/project/actable/0.1.2/", "requires_dist": null, "requires_python": "", "summary": "Flexible activity stream supporting multiple associated objects and fast denormalized look-ups", "version": "0.1.2" }, "last_serial": 3301919, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "24be7bc15eab820a78a78b56d5e36d05", "sha256": "073820a4a6895e7ce17c5dc6b58ccf386dbdbaf0d354d8782c789da53232480e" }, "downloads": -1, "filename": "actable-0.1.1.tar.gz", "has_sig": false, "md5_digest": "24be7bc15eab820a78a78b56d5e36d05", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9639, "upload_time": "2017-11-03T01:53:03", "url": "https://files.pythonhosted.org/packages/ff/07/4f0e662f7707989c8bf00fb7f79eb1df0ffd922b9d2ce4b5bb3ac33b1d50/actable-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "18d3d7424b851185e4ee21c5eebb1b7c", "sha256": "39b4d32084be4f53094ac4c6b5495e736ede71d04ec70a5b95930cf04a20e530" }, "downloads": -1, "filename": "actable-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "18d3d7424b851185e4ee21c5eebb1b7c", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 11611, "upload_time": "2017-11-03T01:54:12", "url": "https://files.pythonhosted.org/packages/1d/aa/7d3e020be458070670dc389f55650e9b9234910d638abcd614916bf28943/actable-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a20a3a73a303cac1fcf7ba181a21039", "sha256": "9069b1e19e42f3d3f18ec01f07b4979292309ba60444655a766579f4de244fc7" }, "downloads": -1, "filename": "actable-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a20a3a73a303cac1fcf7ba181a21039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9643, "upload_time": "2017-11-03T01:54:09", "url": "https://files.pythonhosted.org/packages/69/c9/90460b8ec3a0f737cf0af41909340e8d89eb2f270245e907a59204742c4f/actable-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "18d3d7424b851185e4ee21c5eebb1b7c", "sha256": "39b4d32084be4f53094ac4c6b5495e736ede71d04ec70a5b95930cf04a20e530" }, "downloads": -1, "filename": "actable-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "18d3d7424b851185e4ee21c5eebb1b7c", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 11611, "upload_time": "2017-11-03T01:54:12", "url": "https://files.pythonhosted.org/packages/1d/aa/7d3e020be458070670dc389f55650e9b9234910d638abcd614916bf28943/actable-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a20a3a73a303cac1fcf7ba181a21039", "sha256": "9069b1e19e42f3d3f18ec01f07b4979292309ba60444655a766579f4de244fc7" }, "downloads": -1, "filename": "actable-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a20a3a73a303cac1fcf7ba181a21039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9643, "upload_time": "2017-11-03T01:54:09", "url": "https://files.pythonhosted.org/packages/69/c9/90460b8ec3a0f737cf0af41909340e8d89eb2f270245e907a59204742c4f/actable-0.1.2.tar.gz" } ] }