{ "info": { "author": "Chris Chambers", "author_email": "magma.chambers@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "======================\nDjango Audited Models:\n======================\n\n:author: Chris Chambers\n:date: 2012/05/08\n\nDjango Audited Models provides a simple abstract base class (and factory\nfunction) for tracking database record creation and modification times, as\nwell as the creator of the record and the last user to edit it. It leverages\ntwo pluggable applications to achieve this:\n\n1. `Django Extensions`_, which provides (amongst many other things) a\n ``CreationDateTimeField`` and ``ModificationDateTimeField``.\n2. `Django Threaded Multihost`_, originally developed for Satchmo_, which\n provides a ``threadlocals`` mechanism that works reliably for Django\n installations powering multiple sites via the ``sites`` framework.\n\n\n.. _`Django Extensions`: https://github.com/django-extensions/django-extensions\n.. _`Django Threaded Multihost`: https://bitbucket.org/bkroeze/django-threaded-multihost\n.. _Satchmo: http://www.satchmoproject.com/\n\nInstallation\n============\n\n1. Install pip_.\n2. Run ``pip install django-audited-models``.\n3. Add ``threaded_multihost.middleware.ThreadLocalMiddleware`` to your list of\n ``MIDDLEWARE_CLASSES``.\n4. Inherit from ``AuditedModel`` instead of ``models.Model`` in your django\n applications.\n5. Profit!\n\n.. _pip: http://www.pip-installer.org/en/latest/index.html\n.. _setuptools: http://pypi.python.org/pypi/setuptools\n\nExplanation\n===========\n\nDjango-audited-models fulfils several needs:\n\n1. This kind of metadata is almost always useful, and inexpensive to capture -\n most of your clients will just presume this information is logged and will\n be frustrated if they can't get at it (\"What do you mean we can't see who\n created this record?\")\n2. Django's admin logging functionality provides some of this detail, but is\n flawed in that it only captures events which take place within the admin\n itself.\n3. This app provides a consistent, logical naming convention and interface for\n the metadata.\n4. This app makes use of several other applications to capture this\n information automatically. No need to pollute your views with unrelated\n logic or override ``ModelAdmin`` methods to store the user who created the\n record.\n5. It's pluggable - simply drop it in, install its requirements, inherit from\n ``AuditedModel``, and you'll have your creation/modification dates and the\n users responsible for them, respectively. Similarly, replace your\n ``ModelAdmin`` with the ``AuditedAdmin`` subclass and you'll have some\n sensible defaults for the admin UI (readonly metadata fields, etc.).\n6. As a bonus, ensures that ``MyModel.objects.latest()`` does something\n sensible by default - very handy when working with the interpreter,\n especially.\n\nSome might question the verbosity of the time entry fields\n(``datetime_created`` and ``datetime_modified``). Consider the following::\n\n >>> from datetime import date\n >>> latest_user = User.objects.latest('date_joined')\n >>> if latest_user.date_joined < date.today():\n >>> print \"Nobody has joined the site today.\"\n\n # Intuitively, this looks like it will work, but...\n TypeError: can't compare datetime.datetime to datetime.date\n\nPython treats ``datetime`` objects very differently to ``dates``, and the\nexplicit fieldnames remind the developer of this difference and help prevent\nerrors due to incorrect assumptions.\n\nRequirements\n============\n\n* Python 2.5+\n* Django 1.2+\n* Applications listed in ``requirements.txt``\n\nYou will also need to install the applications listed in\n``requirements-dev.txt`` in order to run the test suite.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/chrischambers/django-audited-models", "keywords": "django,auditing,automatic,abstract", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-audited-models", "package_url": "https://pypi.org/project/django-audited-models/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-audited-models/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/chrischambers/django-audited-models" }, "release_url": "https://pypi.org/project/django-audited-models/0.4.alpha/", "requires_dist": null, "requires_python": null, "summary": "An abstract base class providing automatic creator/editor/datetime_created/datetime_modified fields.", "version": "0.4.alpha" }, "last_serial": 789131, "releases": { "0.1.alpha": [ { "comment_text": "", "digests": { "md5": "2b0b406885ee59d0fb931e9b9cf77126", "sha256": "3dba5f6e686259bdd5fbba3c944e847b0c5534b1862dd2d010fa93085d9d9b11" }, "downloads": -1, "filename": "django-audited-models-0.1.alpha.tar.gz", "has_sig": false, "md5_digest": "2b0b406885ee59d0fb931e9b9cf77126", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3120, "upload_time": "2012-05-09T11:30:55", "url": "https://files.pythonhosted.org/packages/d7/33/7bc19f399e38c0f1bcda12bc45169241baa5af9eea7b8b83ef423f6649c7/django-audited-models-0.1.alpha.tar.gz" } ], "0.2.alpha": [ { "comment_text": "", "digests": { "md5": "40b557647009683a36da12f8d02fa906", "sha256": "24d312ed04d4ba42cd7585720a165e885f32e20ababe0bb1c0f769eebe1e0515" }, "downloads": -1, "filename": "django-audited-models-0.2.alpha.tar.gz", "has_sig": false, "md5_digest": "40b557647009683a36da12f8d02fa906", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4473, "upload_time": "2012-05-09T12:20:59", "url": "https://files.pythonhosted.org/packages/ba/c0/3d20b27e9805d87fcce11c02c9d201b342c73f4d3cfd0ce33079c42ed07d/django-audited-models-0.2.alpha.tar.gz" } ], "0.3.alpha": [ { "comment_text": "", "digests": { "md5": "304fab8b50eabdec0dceca5ed3620876", "sha256": "22322cc401169fae34ed67c77528d3dc9f76f1f3c467f680a9caaaef505b53b1" }, "downloads": -1, "filename": "django-audited-models-0.3.alpha.tar.gz", "has_sig": false, "md5_digest": "304fab8b50eabdec0dceca5ed3620876", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4593, "upload_time": "2012-05-09T12:38:51", "url": "https://files.pythonhosted.org/packages/ad/c4/f77f33f012793fce0e7f3abbb0a168c57016af98922a8a84a4e687433430/django-audited-models-0.3.alpha.tar.gz" } ], "0.4.alpha": [ { "comment_text": "", "digests": { "md5": "6fc5908b0b7dadfd94885adc89db64b3", "sha256": "e06f79215c1d015ec1288d7339c0ae1c83e3db1b38e52bd3ba4120ee9d1dbcbe" }, "downloads": -1, "filename": "django-audited-models-0.4.alpha.tar.gz", "has_sig": false, "md5_digest": "6fc5908b0b7dadfd94885adc89db64b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4549, "upload_time": "2012-05-09T13:36:14", "url": "https://files.pythonhosted.org/packages/7c/d8/0733f6b721ba170bab26d9926cc6511ff93302bd921f78c2fa2968a245f2/django-audited-models-0.4.alpha.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6fc5908b0b7dadfd94885adc89db64b3", "sha256": "e06f79215c1d015ec1288d7339c0ae1c83e3db1b38e52bd3ba4120ee9d1dbcbe" }, "downloads": -1, "filename": "django-audited-models-0.4.alpha.tar.gz", "has_sig": false, "md5_digest": "6fc5908b0b7dadfd94885adc89db64b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4549, "upload_time": "2012-05-09T13:36:14", "url": "https://files.pythonhosted.org/packages/7c/d8/0733f6b721ba170bab26d9926cc6511ff93302bd921f78c2fa2968a245f2/django-audited-models-0.4.alpha.tar.gz" } ] }