{ "info": { "author": "Marcos Schroh", "author_email": "schrohm@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# Django History Actions\n\nDjango app to track actions/events accross systems.\n\n[![Build Status](https://travis-ci.org/marcosschroh/django-history-actions.svg?branch=master)](https://travis-ci.org/marcosschroh/django-history-actions)\n[![codecov](https://codecov.io/gh/marcosschroh/django-history-actions/branch/master/graph/badge.svg)](https://codecov.io/gh/marcosschroh/django-history-actions)\n[![GitHub license](https://img.shields.io/github/license/marcosschroh/django-history-actions.svg)](https://github.com/marcosschroh/django-history-actions/blob/master/LICENSE)\n![PyPI - Python Version](https://img.shields.io/badge/python-3-blue.svg)\n\n\n## **Table of Contents**\n\n- [Features](#features)\n- [Model Description](#model-description)\n- [Quickstart](#quickstart)\n- [Sistem Name](#system-name)\n- [Signals](#signals)\n- [Running Tests](#running-tests)\n\n### Features\n\n1. Save history for your django models.\n2. Define global system name or per model\n3. Actions apps checker.\n4. Signals to track saved models.\n\n### Model Description:\n\n| Field | Description | Type | Required | Default |\n|:-------------|:-----------------|:-----|:---------|:--------------------|\n| author | Action author (username) | str | True | |\n| action | Action performed | str | True | |\n| system | System name | str | True | Taken from settings or model instance |\n| actor | Actor involved in the action (username) | str | False | |\n| created | Action created Datetime | Datetime | False | Auto Generated |\n| content_type | Content Type of the model instance | str | False | Auto Generated from model instance |\n| object_pk | Object pk | int | False | Taken from model instance |\n| notes | Extra note related to the action | TextField | False | |\n| extra | Extra field to store serializable objects. | TextField | False | |\n\n### Quickstart\n\nInstall Django History Actions:\n\n```bash\npip install django-history-events\n```\n\nAdd it to your `INSTALLED_APPS`:\n\n```python\nINSTALLED_APPS = (\n ...\n 'history_actions',\n ...\n)\n\n# Define your System Name\nHISTORY_ACTIONS_SYSTEM = 'main'\n```\n\nDefine your actions.py inside your app\n\n```python\n# actions.py\n\nfrom django.utils.translation import ugettext_lazy as _\n\nINFO_TRAINING_SAVE_ACTION = 'INFO_TRAINING_SAVE_ACTION'\n\nACTIONS = {\n 'INFO_TRAINING_SAVE_ACTION': _('info trainig save action')\n}\n```\n\nNow you can track History:\n\n```python\nfrom history_actions.manager import HistoryManager\n\n# log an event\nHistoryManager.create(\n 'an_author', 'INFO_TRAINING_SAVE_ACTION')\n\n# log an event linked to a model\nmodel_instance = ModelKlass.objects.first()\nHistoryManager.create(\n 'an_author', 'INFO_TRAINING_SAVE_ACTION', model_instance=model_instance)\n\n# log an event linked to a model with more info\nusername = User.ojects.first().username\nHistoryActions.create(\n 'an_author', 'INFO_TRAINING_SAVE_ACTION', model_instance=model_instance, actor=username, notes='My notes')\n\n\n# log an event linked to a model and serialize the model\nusername = User.ojects.first().username\nmodel_instance_dict = model_instance.to_dict()\nHistoryActions.create(\n 'an_author', 'INFO_TRAINING_SAVE_ACTION', model_instance=model_instance, actor=username, notes='My notes', extra=model_instace_dict)\n\n# use a different system\nHistoryActions.create(\n 'an_author', 'INFO_TRAINING_SAVE_ACTION', model_instance=model_instance, actor=username, notes='My notes', extra=model_instace_dict, system=\"custom\")\n```\n\nIf you want to use a diferent system for model tracking, you can define it in:\n\n```python\n# models.py\n\nclass Chatdentity(MachuBaseModel):\n HISTORY_ACTION_SYSTEM = 'chat'\n\n user = models.OneToOneField(User)\n user_two = models.OneToOneField(User, related_name='user_manager')\n given_name = models.CharField(\n 'Given Name(s)', max_length=200, default='')\n family_name = models.CharField(\n 'Family Name(s)', max_length=200, default='')\n```\n\n### System Name\n\nThe system name is taken from:\n\n1. The `create` method `kwargs`.\n2. From `HISTORY_ACTIONS_SYSTEM` variable defined in the `settings.py`.\n3. The class variable `HISTORY_ACTION_SYSTEM` defined in the model class.\n\n### Signals\n\n### Running Tests\n\n```bash\nsource /bin/activate\n(myenv) $ pip install tox\n(myenv) $ tox\n```", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/marcosschroh/django-history-actions", "keywords": "django-history-actions", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-history-actions", "package_url": "https://pypi.org/project/django-history-actions/", "platform": "", "project_url": "https://pypi.org/project/django-history-actions/", "project_urls": { "Homepage": "https://github.com/marcosschroh/django-history-actions" }, "release_url": "https://pypi.org/project/django-history-actions/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Django app to track all actions/events accross systems.", "version": "0.1.1" }, "last_serial": 4273674, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ebd53b6c0e6210f06f791d3960b1dfa1", "sha256": "40f68363dc581cd0c3328125b52f38416e01ddfcaa36053a6232b1a504fc7924" }, "downloads": -1, "filename": "django_history_actions-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ebd53b6c0e6210f06f791d3960b1dfa1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6462, "upload_time": "2018-09-11T18:31:32", "url": "https://files.pythonhosted.org/packages/ef/6b/99e98bd5c4f12ac5e4842ab551ab05c30cc73c225df373c190d7ae92f218/django_history_actions-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "baea748418d4b1849d622e58385c74cd", "sha256": "4519553bc19b8cd883de00a6aac7b00d60ba7292f6a7f0db4b28d36d7047241f" }, "downloads": -1, "filename": "django-history-actions-0.1.0.tar.gz", "has_sig": false, "md5_digest": "baea748418d4b1849d622e58385c74cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7788, "upload_time": "2018-09-11T18:31:30", "url": "https://files.pythonhosted.org/packages/9d/d6/ab8d6b8904e7dc44b7ab3572c3b8ddd8bd7910d40548fff9713dc349f96b/django-history-actions-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f8d38ddc0cc6d2c6abbfbc911d2cfb52", "sha256": "0dcd7875268f53b08174a2286fc2cb264c535ea40386f39765d3e11036f22fe4" }, "downloads": -1, "filename": "django_history_actions-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f8d38ddc0cc6d2c6abbfbc911d2cfb52", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7604, "upload_time": "2018-09-14T20:53:31", "url": "https://files.pythonhosted.org/packages/7a/df/84ea6721429eb3f10b7d7772fc1e07816d0cbf59117b631b3e51923ab413/django_history_actions-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e030aad31597f62f9067516f3552972e", "sha256": "549d0d43d7da1e3fab038f4eecd481447a6b29235a8b61899fe9295bdc383663" }, "downloads": -1, "filename": "django-history-actions-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e030aad31597f62f9067516f3552972e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8268, "upload_time": "2018-09-14T20:53:29", "url": "https://files.pythonhosted.org/packages/89/22/46df55340dbbe93cd5ef3c355e7c1091aae3da6e59ea75fd2e85b90a20aa/django-history-actions-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f8d38ddc0cc6d2c6abbfbc911d2cfb52", "sha256": "0dcd7875268f53b08174a2286fc2cb264c535ea40386f39765d3e11036f22fe4" }, "downloads": -1, "filename": "django_history_actions-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f8d38ddc0cc6d2c6abbfbc911d2cfb52", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 7604, "upload_time": "2018-09-14T20:53:31", "url": "https://files.pythonhosted.org/packages/7a/df/84ea6721429eb3f10b7d7772fc1e07816d0cbf59117b631b3e51923ab413/django_history_actions-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e030aad31597f62f9067516f3552972e", "sha256": "549d0d43d7da1e3fab038f4eecd481447a6b29235a8b61899fe9295bdc383663" }, "downloads": -1, "filename": "django-history-actions-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e030aad31597f62f9067516f3552972e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8268, "upload_time": "2018-09-14T20:53:29", "url": "https://files.pythonhosted.org/packages/89/22/46df55340dbbe93cd5ef3c355e7c1091aae3da6e59ea75fd2e85b90a20aa/django-history-actions-0.1.1.tar.gz" } ] }