Commit Graph

63 Commits

Author SHA1 Message Date
Jannis Leidel d68666700f Fixed #16604 -- Use new save_related hook when saving objects on the changelist, too. Thanks, pdeglopper.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-12 14:14:24 +00:00
Ramiro Morales 87eb3a25aa Removed superflous commented-out lines.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-04 12:23:12 +00:00
Jannis Leidel 332a485567 Fixed #16115 -- Added ModelAdmin.save_related method to be able to do pre- or post-save operations for objects related to the parent object currently displayed. Thanks, Julien Phalip.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-03 17:56:43 +00:00
Luke Plant cb996cce05 Fixed various bugs related to having multiple columns in admin list_display with the same sort field
Thanks to julien for the report

Refs #11868

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-03 11:54:29 +00:00
Luke Plant 5434ce231d Fixed #11868 - Multiple sort in admin changelist.
Many thanks to bendavis78 for the initial patch, and for input from others.

Also fixed #7309. If people were relying on the undocumented default ordering
applied by the admin before, they will need to add 'ordering = ["-pk"]' to
their ModelAdmin.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16316 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-02 16:18:47 +00:00
Luke Plant 8eccb728cc Fixed #15964 - Do not order admin actions by description
Thanks to julien for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-05 22:03:17 +00:00
Jannis Leidel 18d2f4a816 Fixed #5833 -- Modified the admin list filters to be easier to customize. Many thanks to Honza Král, Tom X. Tobin, gerdemb, eandre, sciyoshi, bendavis78 and Julien Phalip for working on this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16144 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-03 10:44:23 +00:00
Jannis Leidel 6c17190bf8 Fixed #11639, #13618 -- Added get_prepopulated_fields method to ModelAdmin and InlineModelAdmin to be able to handle prepopulated fields on a case-by-case basis. Thanks, leanmeandonothingmachine.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22 12:02:25 +00:00
Adrian Holovaty 4e25bc71b1 Fixed #15609 -- Fixed some 'raise' statements to use the newer style syntax. Thanks, DaNmarner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-14 23:00:03 +00:00
Ian Kelly 8b22f7cf78 Fixed field names that were preventing the tests from running in Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-08 19:26:32 +00:00
Jannis Leidel b921f1bac0 Fixed #12475 -- Fixed an edge case with hidden fields in ModelAdmin changelists when used in conjunction with list_display_links or list_editable. Thanks, Simon Meers, Julien Phalip, Karen and master.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03 13:20:45 +00:00
Ramiro Morales bd3b5e8c2b Fixed #15517 -- Fixed regression in admin search_fields option introduced in r15526. Thanks Fabian Buechler for the report and fix and Julien Phalip for adding tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01 02:04:35 +00:00
Ramiro Morales 52fc61e0cf Fixed #14529 -- Fixed representation of model names in admin messages after model object changes when the ModelAdmin queryset() uses defer() or only(). Thanks rlaager for report and initial patch, to rasca an julien for help in tracking the problem.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15596 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-20 23:09:25 +00:00
Russell Keith-Magee 75a1aaa1f9 Fixed #11513 -- Ensure that the redirect at the end of an object change won't redirect to a page for which the user doesn't have permission. Thanks to rlaager for the report and draft patch, and to Julien Phalip for the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-19 14:05:07 +00:00
Russell Keith-Magee fe3c9ad551 Fixed #14355 -- Ensure that help_text is displayed for readonly fields in the admin. Thanks to jester for the report, and to alexbmeng, subsume, wamberg and Julien Phalip for ther work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15582 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-19 12:55:09 +00:00
Russell Keith-Magee 791ecb4be4 Fixed #13126 -- Ensured that individual form errors are displayed when errors occur on a list-editable changelist. Thanks to slafs for the report, and to Julien Phalip for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-19 11:48:42 +00:00
Russell Keith-Magee 74ffca17e2 Fixed #10573 -- Corrected autofocus problem in admin when the first widget displayed is a multiwidget. Thanks to rduffield for the report, and to Ramiro and Julien Phalip for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15452 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-08 12:00:21 +00:00
Luke Plant 655d5afea9 Fixed #14880 - raw_id_fields in admin does not work when limit_choices_to dictionary has value=False
Thanks to smallming for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-28 14:08:42 +00:00
Luke Plant c24bdf044b Fixed #15103 - SuspiciousOperation with limit_choices_to and raw_id_fields
Thanks to natrius for the report.

This patch also fixes some unicode bugs in affected code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15347 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-28 14:08:25 +00:00
Carl Meyer 93a4d46184 Fixed #14672 - Added admin handling for on_delete=PROTECT. Thanks to jtiai for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-20 00:33:32 +00:00
Ramiro Morales 1c56af676d Added tests demonstrating that filtering lookup expression that involve model with inheritance schemes aren't incorrectly blacklisted by the r15031 security fix. Refs. #15032.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15178 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-12 23:30:47 +00:00
Russell Keith-Magee 6bd8c14be9 Fixed #14999 -- Ensure that filters on local fields are allowed, and aren't caught as a security problem. Thanks to medhat for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-03 13:56:31 +00:00
Alex Gaynor 732198ed5c Fix a security issue in the admin. Disclosure and new release forthcoming.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-23 03:44:38 +00:00
Jannis Leidel 2c2209b473 Fixed #13607 -- Auto-initialize admin's date hierarchy links intelligently. Thanks, Simon Meers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14879 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-12 22:54:50 +00:00
Honza Král dc334a2ba8 Fixed #3400 -- Support for lookup separator with list_filter admin option. Thanks to DrMeers and vitek_pliska for the patch!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14674 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 19:29:15 +00:00
Alex Gaynor 274aba3b9b Fixed #11108 -- added ModelAdmin.delete_model, a hook with which to perform custom pre-post delete behavior. Thanks to Florian Apolloner for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 19:00:40 +00:00
Russell Keith-Magee 2ab3b52d2a Fixed #14012 -- Corrected the handling of the create user popup dialog in the admin. Thanks to gk@lka.hu for the report, and Ramiro Morales for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06 14:58:05 +00:00
Russell Keith-Magee faceca7075 Fixed #13301 -- Corrected problem with capitalization of changelist row headers in admin. Thanks to emyller for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-11 08:35:04 +00:00
Russell Keith-Magee c421a4fd92 Fixed #11949 -- Added a hook to allow ModelAdmin customization of the delete selected template. Thanks to bendavis78 for the report and patch, and Ramiro Morales for his cleanup work.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-05 12:02:27 +00:00
Karen Tracey f88c2f16e8 Fixed #13004: Ensure the add page for a model with a ManyToManyField specified
in readonly_fields does not raise an exception. Thanks hejsan, mlavin, copelco.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@12827 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-21 14:23:25 +00:00
Karen Tracey 883329ecb3 Fixed #12105: Corrected handling of isnull=False lookups in admin. Thanks marcob, Travis Cline, gabrielhurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-16 19:01:40 +00:00
Karen Tracey cc6e9b2286 Fixed #12434: Made pretty_name handle empty string and None as input. Thanks ales_zoulek and gabrielhurley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-16 16:10:27 +00:00
James Bennett a0c77ada99 Ensure that NullBooleanField displays the appropriate icon for null values in admin changelists. Refs #13071.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-10 08:37:17 +00:00
Karen Tracey 6d7754ba03 Fixed #11710: Made a small test change to ensure utf-8 bytestrings in
verbose_names don't cause a server error when the admin change log message is
built. The necessary code fix was made for #12966 in r12627.  Thanks Rupe.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@12650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-02 03:28:48 +00:00
Russell Keith-Magee e12b3199d0 Fixed #6191, #11296 -- Modified the admin deletion confirmation page to use the same object collection scheme as the actual deletion. This ensures that all objects that may be deleted are actually deleted, and that cyclic display problems are avoided. Thanks to carljm for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-26 13:17:43 +00:00
Jannis Leidel 342517000c Added missing tests for fix committed in r12398. Thanks Karen for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-16 12:17:37 +00:00
Jannis Leidel 31f3a8c1ad Fixed #10640 - Adds a add_form_template option to ModelAdmin. Thanks jcsackett.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12216 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12 23:34:03 +00:00
Brian Rosner bcd9482a20 Fixed #342 -- added readonly_fields to ModelAdmin. Thanks Alex Gaynor for bootstrapping the patch.
ModelAdmin has been given a readonly_fields that allow field and calculated
values to be displayed alongside editable fields. This works on model
add/change pages and inlines.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11965 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 18:29:00 +00:00
Jannis Leidel ca2d64788d Fixed #9749 - Added hook to ModelAdmin for specifying custom ChangeLists. Thanks to David Larlet and Eric Florenzano.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-18 10:08:05 +00:00
Russell Keith-Magee 7ecb8b08b3 Fixed #10922 -- Corrected handling of POST data to ensure that the right objects are updated on save when the ordering field is editable. Thanks to Alex Gaynor, Karen Tracy, and Will Hardy for their contributions to this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-03 03:05:17 +00:00
Russell Keith-Magee 2c2871b7c3 Fixed #11042 -- Corrected admin inlines for inherited models. Thanks to jsmullyan for the report, and mir for helpful triage work. Patch includes regression test for #8093, and a commented out test for #10992.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-09 11:40:13 +00:00
Jacob Kaplan-Moss 23fa913676 Fixed #10448: correcting errors on "save as new" now correctly create a new object instead of modifying the old one. Thanks, bastih.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10713 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-08 12:53:14 +00:00
Russell Keith-Magee b5f0aff922 Fixed #10516 -- Corrected admin search when the search_fields definition contains multiple fields on the same base model. Thanks to Zain Memon for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 12:52:43 +00:00
Russell Keith-Magee eb81d5acb3 Fixed #10893 -- Corrected a problem with using list_editable in the admin when the model has a manual primary key. Thanks to Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 11:56:10 +00:00
Jacob Kaplan-Moss ccc8e104ee Fixed #10799: fixed the use of list_editable with model inheritance and custom one-to-one parent links. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 21:03:29 +00:00
Jacob Kaplan-Moss 1e4ad6f118 Fixed #10002: inline file uploads now correctly display prior data. Thanks, dgouldin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-18 20:29:55 +00:00
Malcolm Tredinnick 3bd384aa62 Fixed #10645 -- Added some robustness around some admin and modelform params.
Fieldset dictionary names, search fields and unique_together attribute
names all have to be convertible to strings (that has always been true).
If somebody passes in a unicode object, Python barfs because Django uses
those values as keyword argument names and function calls require
parameter names to be str objects. We now convert thing to strs
automatically.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-11 07:41:59 +00:00
Jacob Kaplan-Moss bb15cee58a Made a bunch of improvements to admin actions. Be warned: this includes one minor but BACKWARDS-INCOMPATIBLE change.
These changes are:

    * BACKWARDS-INCOMPATIBLE CHANGE: action functions and action methods now share the same signature: `(modeladmin, request, queryset)`. Actions defined as methods stay the same, but if you've defined an action as a standalone function you'll now need to add that first `modeladmin` argument.
    * The delete selected action is now a standalone function registered site-wide; this makes disabling it easy.
    * Fixed #10596: there are now official, documented `AdminSite` APIs for dealing with actions, including a method to disable global actions. You can still re-enable globally-disabled actions on a case-by-case basis.
    * Fixed #10595: you can now disable actions for a particular `ModelAdmin` by setting `actions` to `None`.
    * Fixed #10734: actions are now sorted (by name).
    * Fixed #10618: the action is now taken from the form whose "submit" button you clicked, not arbitrarily the last form on the page.
    * All of the above is documented and tested.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-06 20:23:33 +00:00
Jacob Kaplan-Moss 8f7aa84def Fixed #9651: fixed save_as with inline forms. Thanks, kmike and Mnewman.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-02 00:01:15 +00:00
Jacob Kaplan-Moss ee17cabba0 Fixed #9969: choices with options groups (added in [7977]) now work correctly in the admin with list_display and list_filter. Thanks, ramiro.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-01 14:14:20 +00:00