{ "info": { "author": "Matthew Schinckel", "author_email": "matt@schinckel.net", "bugtrack_url": null, "classifiers": [ "Framework :: Django", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "django-admin-additions\n======================\n\nThere are a few things about the django admin that get me down. Here are solutions to\nthose, all bundled up together.\n\nInstallation\n------------\n\nAdd ``'admin_additions'`` to you ``settings.INSTALLED_APPS``.\n\nThen configure the additions you want to use. The default settings are shown:\n\n::\n\n ADMIN_ADDITIONS = {\n 'RETURN_TO_FILTERED_CHANGELIST': False,\n 'SAVE_ON_TOP': True,\n 'LIST_SELECT_RELATED': False,\n 'FULLY_DYNAMIC_FORMSETS': True\n }\n\nSettings\n------------\n\nRETURN_TO_FILTERED_CHANGELIST\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nWhen editing an object, you usually want to revert back to the filtered view\nfrom whence you came.\n\nThis is a monkey-patch that supplements the normal `change_view` method on the\n`ModelAdmin` base class, and ensures that it returns after a POST back to the \nreferring view.\n\nThis method of returning to the filtered view after submitting a form in an admin\nchange view is based largely upon `Snippet 2531 `.\n\nSAVE_ON_TOP\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nShould be the default: display the save toolbar on the top of every `change_view`.\n\nLIST_SELECT_RELATED\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nTurn on automatic `.select_related()` for all queries for a change_list. If you have\naltered the display columns, and do any lookups at all, this is a good idea.\n\nFULLY_DYNAMIC_FORMSETS\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSets the `extra` value on `InlineModelAdmin` to 0, so you just use the addition button\ninstead of having any empty formsets.\n\nPatching functions\n------------------------\n\n``patch_model_admin(model, patch_function)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nPatch an installed ``ModelAdmin``. This includes unregistering, patching and then re-registering. You may pass in a model, or a string of the form `\"app_label.ModelName\"`, and a function that will take and patch a ``ModelAdmin`` class.\n\nIf you create a new class based on the passed in class, then you may return it: that will then be used within the re-registration. If you simply patch the existing class, you can return nothing, and the patched original class will be used.\n\n::\n\n from admin_additions.patchers import patch_model_admin\n \n def patcher_function(model_admin):\n # Do stuff here.\n model_admin.form = MyClassyForm\n return model_admin # optional: you may patch in-place\n \n patch_model_admin(MyModel, patcher_function)\n\n``add_inlines(model, *inlines)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA simple/common case of patching a ``ModelAdmin`` - adding a new inline:\n\n::\n\n from django.contrib import admin\n from admin_additions.patchers import add_inlines\n \n from models import Foo\n \n class FooInline(admin.StackedInline):\n model = Foo\n \n add_inlines('bar.Bar', FooInline)\n \nYou may pass multiple inlines.\n\nYou may also pass in any combination of models or admin inlines: if a model is received, it will create a ``StackedInline`` for that model.\n\n``add_actions(model, *actions)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nLike for inlines, but add an action.\n\n``@patch_admin(model)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nA decorator, that can decorate a function to be patched.\n\n::\n\n from admin_additions.patchers import patch_admin\n \n @patch_admin(model)\n def patcher_function(model_admin):\n model_admin.form = MyClassyForm\n\nThis syntax is terser than the ``patch_model_admin`` function above.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://hg.schinckel.net/django-admin-additions", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-admin-additions", "package_url": "https://pypi.org/project/django-admin-additions/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-admin-additions/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://hg.schinckel.net/django-admin-additions" }, "release_url": "https://pypi.org/project/django-admin-additions/1.0.2/", "requires_dist": null, "requires_python": null, "summary": "Admin additions.", "version": "1.0.2" }, "last_serial": 789039, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "116d945e764f152926c16fc09693612e", "sha256": "9965ca9587a385073f423d57fab15fbf6593223f9f2889d37ea922ebac44137d" }, "downloads": -1, "filename": "django-admin-additions-1.0.0.tar.gz", "has_sig": false, "md5_digest": "116d945e764f152926c16fc09693612e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4185, "upload_time": "2012-07-25T08:38:09", "url": "https://files.pythonhosted.org/packages/c3/14/b8f5a95341b5ad9f1c52baef18e18711656c57240f88a0ee3e95f0ea4cc6/django-admin-additions-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7120f3f4b9a85e3d28f06bcf912001ef", "sha256": "ba2e1ed1df28dd33e73ba9dc03eee200f97fa8782c8a6d57fa1157dc3ff5fbee" }, "downloads": -1, "filename": "django-admin-additions-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7120f3f4b9a85e3d28f06bcf912001ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4211, "upload_time": "2012-07-25T08:44:52", "url": "https://files.pythonhosted.org/packages/e5/ab/f5215703a43dd70f8e8de0660ea3ad82ad5bd90e23ff57b4a74c33a56cd8/django-admin-additions-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "b78779f5be03237497e7672e0d49cbf0", "sha256": "4cf91ac8ae50d0d61f8e5fa0703ec2c5f3c7f3b1b36c2182b1420968aa2bec4b" }, "downloads": -1, "filename": "django-admin-additions-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b78779f5be03237497e7672e0d49cbf0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4226, "upload_time": "2012-07-25T09:10:26", "url": "https://files.pythonhosted.org/packages/a4/2d/c23b5b38a109a2b18892395f93dbc9e92776edcac9fab32d9a1f96fe5bc6/django-admin-additions-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b78779f5be03237497e7672e0d49cbf0", "sha256": "4cf91ac8ae50d0d61f8e5fa0703ec2c5f3c7f3b1b36c2182b1420968aa2bec4b" }, "downloads": -1, "filename": "django-admin-additions-1.0.2.tar.gz", "has_sig": false, "md5_digest": "b78779f5be03237497e7672e0d49cbf0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4226, "upload_time": "2012-07-25T09:10:26", "url": "https://files.pythonhosted.org/packages/a4/2d/c23b5b38a109a2b18892395f93dbc9e92776edcac9fab32d9a1f96fe5bc6/django-admin-additions-1.0.2.tar.gz" } ] }