{ "info": { "author": "Henrik Heimbuerger", "author_email": "henrik@smileback.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "# django-model-audit-history\n\nProvides an `AuditHistory` model field to store a chronological record of changes to a model (\u201caudit history\u201d) on the model. The historical record is stored in a designated JSON field, so no additional database tables are required.\n\nSupports Django 1.11 (and possibly Django 2.x in the future) and PostgreSQL database backends.\n\n## CI\n\n[![Build Status](https://travis-ci.org/nexto/django-model-audit-history.svg?branch=master)](https://travis-ci.org/nexto/django-model-audit-history)\n\n## Usage\n\nThe basic principles are as follows:\n\n1. To enable this for a model, you have to make these changes:\n\n * add an `AuditHistoryField` named `history` to the model\n * add the `AuditHistoryMixin` to the model class\n * create ModelAdmin:\n ```\n ModelAdmin(AuditHistoryAdminMixin, admin.ModelAdmin): \n pass\n ```\n * add your ModelAdmin to admin site `admin.site.register(model, ModelAdmin)`\n\n2. Then, instead of calling regular `save()` on the model after changing it, call `save_with_audit_record()` instead (passing in some meta data you want saved alongside, e.g. the `event` that caused the change, the `user` triggering it and some `payload` usually the set of modified fields.\n\n3. The history will appear in human-readable form in the admin.\n\nThat\u2019s pretty much all there is to it.\n\n## Testapp setup and first steps\n\n1. Install Postgres locally (e.g. 10.x)\n2. Create local database `audithistory`, owned by user `dev`\n3. Create a virtualenv and activate: `virtualenv venv`, then `source venv/bin/activate`\n4. Install dependencies into virtualenv: `pip install --requirement requirements.txt`\n5. Run `manage.py migrate`\n6. Run `manage.py createsuperuser`\n7. Run `manage.py runserver`\n8. Create new model on http://localhost:8000/admin/test_app/blogpost/\n9. Edit model via http://localhost:8000/edit/1/\n10. Reload admin page and inspect history record\n\n## Run tests in local environment:\n\n* Run `manage.py test` (Ensure that user dev has rights to db creation `alter user dev createdb;`)\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nexto/django-model-audit-history", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "django-model-audit-history", "package_url": "https://pypi.org/project/django-model-audit-history/", "platform": "", "project_url": "https://pypi.org/project/django-model-audit-history/", "project_urls": { "Homepage": "https://github.com/nexto/django-model-audit-history" }, "release_url": "https://pypi.org/project/django-model-audit-history/1.1.3/", "requires_dist": [ "Django (<2.0)", "ipaddress", "six" ], "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "summary": "A Django model field for PostgreSQL to store changes to a model chronologically.", "version": "1.1.3" }, "last_serial": 5233054, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a07442a13549f85dc8b2dc9fd2a4b36a", "sha256": "de721fcb715c3929106c4bab4894cad0636f593b679b85f9c768b50a51ff37f7" }, "downloads": -1, "filename": "django_model_audit_history-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "a07442a13549f85dc8b2dc9fd2a4b36a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6822, "upload_time": "2019-03-15T10:59:51", "url": "https://files.pythonhosted.org/packages/71/5c/b5e2c1b9d5ca728fc868366b98b41742e8fe2f2e91f2fea4e6db3d90c7e3/django_model_audit_history-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e77db615cb77108c7e1ae3f456ce7e71", "sha256": "df7ad1f591e4fee3fcb26cf50761d75017e87efb310b3c13a7cbdde4a7e3dd21" }, "downloads": -1, "filename": "django-model-audit-history-1.0.tar.gz", "has_sig": false, "md5_digest": "e77db615cb77108c7e1ae3f456ce7e71", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 5971, "upload_time": "2019-03-15T10:59:53", "url": "https://files.pythonhosted.org/packages/3d/bf/48ba3519ac2969007e868361788bdffa88837a04e41ca25760481e4b1f91/django-model-audit-history-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "dcb62710b24a843d836048a613ed15dc", "sha256": "65d08f3256d9ed50e303d7322b352c04dc7ab3626883b47bf657c86bbfc8112e" }, "downloads": -1, "filename": "django_model_audit_history-1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "dcb62710b24a843d836048a613ed15dc", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6932, "upload_time": "2019-03-18T23:24:40", "url": "https://files.pythonhosted.org/packages/ee/4a/fd194cc25b1e02c8a31223faab80b53d259b6ea19ed6da6819a353c36140/django_model_audit_history-1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d66536727547b48ef6f1172df26dc9bd", "sha256": "e9951b9344d0164ab73a7845534d9070c451fb1a492512901b3264e236f86415" }, "downloads": -1, "filename": "django-model-audit-history-1.1.tar.gz", "has_sig": false, "md5_digest": "d66536727547b48ef6f1172df26dc9bd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 5925, "upload_time": "2019-03-18T23:24:41", "url": "https://files.pythonhosted.org/packages/f5/1f/36137432a97967deb2cef6ecf8de9f77ee67dc596220358fd044ab194508/django-model-audit-history-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "9be1edbb8a5499ff6e05016363ed2f43", "sha256": "7b19efeb3af1945d27e56b5d55c47d9d2d1af4db17165451e90c9bc0f2a480aa" }, "downloads": -1, "filename": "django_model_audit_history-1.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "9be1edbb8a5499ff6e05016363ed2f43", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6842, "upload_time": "2019-03-19T09:04:47", "url": "https://files.pythonhosted.org/packages/1f/ab/ed6b597832a88f7f2a76d0166c0ac20df44850656c533b09156f7bc18b08/django_model_audit_history-1.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d058fba39dc224713dae6d2e3eb2dbf", "sha256": "bd090810bc157fa84048eb7666075ffb43df714ea07bc3f439859c992a9ab64e" }, "downloads": -1, "filename": "django-model-audit-history-1.1.1.tar.gz", "has_sig": false, "md5_digest": "5d058fba39dc224713dae6d2e3eb2dbf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 5976, "upload_time": "2019-03-19T09:04:48", "url": "https://files.pythonhosted.org/packages/1e/1f/56315b8c1af63b647b7cc30f0e1ee817bad0d13ef1b81f2ece4d26ea349f/django-model-audit-history-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "38ca032b677570ad1f1971473f3d47af", "sha256": "d94dfd31296ffcf21a1014e52bed65f9070d6dc090d42f107a02f6c68042f4e1" }, "downloads": -1, "filename": "django_model_audit_history-1.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "38ca032b677570ad1f1971473f3d47af", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6887, "upload_time": "2019-03-19T09:06:00", "url": "https://files.pythonhosted.org/packages/8f/a3/018d5ec367473fde131f281eb9e57fc264671cb7b05cf8d78361bbb8122e/django_model_audit_history-1.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "440233c81c2b39b139b14058e08cdef6", "sha256": "1308086696088c757defa50cca0ffe29dcae22161a0715b4d59f046514e6cf88" }, "downloads": -1, "filename": "django-model-audit-history-1.1.2.tar.gz", "has_sig": false, "md5_digest": "440233c81c2b39b139b14058e08cdef6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6066, "upload_time": "2019-03-19T09:06:02", "url": "https://files.pythonhosted.org/packages/fd/af/2ffac33d40adc092d58e51166331cfb8463406528bbf68d1113a6798f398/django-model-audit-history-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "ed66d2e00fda3c4c30f31b65f57e4a79", "sha256": "f7b13ec2d878585ed74e1a21e0c2bdc778dd57aa5306b6822d366b6ceaba1381" }, "downloads": -1, "filename": "django_model_audit_history-1.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "ed66d2e00fda3c4c30f31b65f57e4a79", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 8961, "upload_time": "2019-05-06T13:33:10", "url": "https://files.pythonhosted.org/packages/dc/d2/dff89addb0d8bfa85792b57d4f5c8e4a87c6da2f33276b00a91e4331e7a1/django_model_audit_history-1.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d69ab6637cecd91d202b32cfa756dbe", "sha256": "ed557cdedade5e23d8be75bc1970b0f58f5fbe5032d74da806dde32658d18dcd" }, "downloads": -1, "filename": "django-model-audit-history-1.1.3.tar.gz", "has_sig": false, "md5_digest": "1d69ab6637cecd91d202b32cfa756dbe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6103, "upload_time": "2019-05-06T13:33:12", "url": "https://files.pythonhosted.org/packages/cc/8e/c61d94c12059d63605e045f120853e7a78e694f6c90f39b97268d326905a/django-model-audit-history-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ed66d2e00fda3c4c30f31b65f57e4a79", "sha256": "f7b13ec2d878585ed74e1a21e0c2bdc778dd57aa5306b6822d366b6ceaba1381" }, "downloads": -1, "filename": "django_model_audit_history-1.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "ed66d2e00fda3c4c30f31b65f57e4a79", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 8961, "upload_time": "2019-05-06T13:33:10", "url": "https://files.pythonhosted.org/packages/dc/d2/dff89addb0d8bfa85792b57d4f5c8e4a87c6da2f33276b00a91e4331e7a1/django_model_audit_history-1.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d69ab6637cecd91d202b32cfa756dbe", "sha256": "ed557cdedade5e23d8be75bc1970b0f58f5fbe5032d74da806dde32658d18dcd" }, "downloads": -1, "filename": "django-model-audit-history-1.1.3.tar.gz", "has_sig": false, "md5_digest": "1d69ab6637cecd91d202b32cfa756dbe", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", "size": 6103, "upload_time": "2019-05-06T13:33:12", "url": "https://files.pythonhosted.org/packages/cc/8e/c61d94c12059d63605e045f120853e7a78e694f6c90f39b97268d326905a/django-model-audit-history-1.1.3.tar.gz" } ] }