summaryrefslogtreecommitdiff
path: root/django/contrib/admin/validation.py
AgeCommit message (Collapse)Author
2015-01-18Removed support for admin validators per deprecation timeline; refs #16905.Tim Graham
2015-01-06Fixed #12663 -- Formalized the Model._meta API for retrieving fields.Daniel Pyrathon
Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
2015-01-02Fixed #9104 -- Moved FieldDoesNotExist to core.exceptionsDaniel Pyrathon
2014-09-05Limited lines to 119 characters in django/Tim Graham
refs #23395.
2014-03-30Corrected many style guide violations that the newest version of flake8 catchesAlex Gaynor
2013-12-30Stopped populating the app registry as a side effect.Aymeric Augustin
Since it triggers imports, it shouldn't be done lightly. This commit adds a public API for doing it explicitly, django.setup(), and does it automatically when using manage.py and wsgi.py.
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-22Terminated AppCache._populate() with extreme prejudice.Aymeric Augustin
It was called _populate() before I renamed it to populate(). Since it has been superseded by populate_models() there's no reason to keep it. Removed the can_postpone argument of load_app() as it was only used by populate(). It's a private API and there's no replacement. Simplified load_app() accordingly. Then new version behaves exactly like the old one even though it's much shorter.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Removed the _-prefix for populate().Aymeric Augustin
Several parts of Django call get_apps() with a comment along this lines of "this has the side effect of calling _populate()". I fail to see how this is better than just calling populate()!
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
2013-11-28Fixed E125 pep8 warningsChristopher Medrela
2013-11-02Fixed all E261 warningscoagulant
2013-10-31Started attackign the next flake8 violationAlex Gaynor
2013-10-29Fixed #8261 -- ModelAdmin hook for customising the "show on site" buttonUnai Zalakain
``ModelAdmin.view_on_site`` defines wether to show a link to the object on the admin detail page. If ``True``, cleverness (i.e. ``Model.get_absolute_url``) is used to get the url. If it's a callable, the callable is called with the object as the only parameter. If ``False``, not link is displayed. With the aim of maitaining backwards compatibility, ``True`` is the default.
2013-10-14Fixed #21266 -- Fixed E201,E202 pep8 warnings.Larry O'Neill
2013-10-01Fixed #15185 -- Allowed ModelAdmin.list_display_links=None to disable change ↵Ramiro Morales
list links. Thanks rm_ for the suggestion.
2013-09-16Fixed #17627 -- Renamed util.py files to utils.pyTim Graham
Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
2013-06-19Removed several unused imports.Aymeric Augustin
2013-06-05Fixed #19080 -- Fine-grained control over select_related in adminTomek Paczkowski
2013-05-19Fixed #12674 -- provide a way to override admin validationHonza Kral
Moved admin validation code to classes and have those be class attributes to the ModelAdmin classes.
2013-05-09Further removal of static admin validation that can fail erroneouslyLuke Plant
2013-05-09Removed fragile admin validation of fields on ModelFormLuke Plant
Refs #19445
2013-02-02Fixed #19445 -- Skip admin fieldsets validation when the ↵Nick Sandford
ModelAdmin.get_form() method is overridden.
2011-09-08Fixed #15997 -- Added `list_max_show_all` option to `ModelAdmin` in ↵Jannis Leidel
replacement for a global module level variable. Thanks, jsdalton. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16725 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-26Fixed #15669 -- Included app label in admin validation messages. Thanks, ↵Jannis Leidel
lamby and Jure Cuhalev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16462 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-24Fixed #16080 -- Handle admin list filter items with two characters better. ↵Jannis Leidel
Thanks, Ales Zoulek and Julien Phalip. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-22Fix UnboundLocalError than could occur during ModelAdmin validation.Karen Tracey
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16262 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-14Added ability to describe grouping of form fields in the same row to the ↵Ramiro Morales
`fields` ModelAdmin attribute. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-03Fixed #5833 -- Modified the admin list filters to be easier to customize. ↵Jannis Leidel
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-03-03Fixed #15512 -- Cleanup of imports in contrib.admin. Thanks to Julien Phalip ↵Russell Keith-Magee
for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15719 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-26Fixed #15424 -- Corrected lookup of callables listed in admin inlines' ↵Ramiro Morales
`readonly_fields` by passing the right ModelAdmin (sub)class instance when instantiating inline forms admin wrappers. Also, added early validation of its elements. Thanks kmike for the report and Karen for the patch fixing the issue. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15650 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-21Fixed #11058 - list_display_links doesn't allow callables not defined in the ↵Luke Plant
model Thanks to dvine for the report and julien for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21Fixed #3400 -- Support for lookup separator with list_filter admin option. ↵Honza Král
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-10-12Fixed #14425 -- Unused imports in contrib.admin. Thanks robhudson.Chris Beaven
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14175 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-26Fixed #13827 -- Cleaned up a few unnecessary function calls.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-27Fixed #13023 - Removed ambiguity with regard to the max_num option of ↵Jannis Leidel
formsets and as a result of admin inlines. Thanks to Gabriel Hurley for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12872 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-09Fixed #12689: Fixed admin validation to report an error on invalid exclude ↵Karen Tracey
specification. Thanks for report to bparker and for patch with tests to ramiro. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12734 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08Fixed #12481: Updated admin validation code to not reject non-editable ↵Karen Tracey
fields in readonly_fields, since these are handled fine by the display code itself. Thanks lashni and Alex. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-23ModelAdmin.fields wasn't able to refer to fields only on a custom formBrian Rosner
Regressed in r11737 which used get_field instead of opts.get_field and ignoring fields not found. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12279 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #342 -- added readonly_fields to ModelAdmin. Thanks Alex Gaynor for ↵Brian Rosner
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-11-19Corrected a regression in validation of admin fieldsets with nested ↵Russell Keith-Magee
definitions from r11744. Thanks to Davor Lučić for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-18Fixed #12237 -- Improved the error message for m2m fields with an explicit ↵Russell Keith-Magee
through model being listed in admin fieldsets. Thanks to Pyth for the report and Ramiro Morales for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11744 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-13Refs #12203 -- Improved error handling for the case where a user manually ↵Russell Keith-Magee
specifies an m2m field with an explicit through field. Thanks to dgouldin for the report, and Ramiro Morales for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-23Moved _get_foreign_key call after testing for fk_name fixing a broken test.Brian Rosner
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-19Moved the call to _get_foreign_key to run in all cases catching incorrect ↵Brian Rosner
inline setup sooner. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11631 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-10-19Fixed #11709 — Pass inline fk_name attribute when grabbing foreign key to ↵Brian Rosner
test for exclusion. Thanks yishaibeeri for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11630 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10Changed r10668 to not falsely error out when using generic inlines.Malcolm Tredinnick
The bug was picked up by the tests already, but only if run against a backend that supports referential integrity. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10732 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-03Fixed #9932 -- Added a validation error when an inline tries to exclude the ↵Russell Keith-Magee
foreign key that provides the link to the parent model. Thanks to david for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10668 bcc190cf-cafb-0310-a4f2-bffc1f526a37