1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #23750 -- Allowed core.checks.register to be used as a function

This commit is contained in:
averybigant
2014-11-05 14:01:49 +08:00
committed by Tim Graham
parent b3fd39f7c8
commit b7a5b6ab86
8 changed files with 71 additions and 14 deletions

View File

@@ -151,6 +151,20 @@ settings file like this::
These checks will only be run if the :djadminopt:`--deploy` option is passed to
the :djadmin:`check` command.
You can also use ``register`` as a function rather than a decorator by
passing a callable object (usually a function) as the first argument
to ``register``.
The code below is equivalent to the code above::
def my_check(app_configs, **kwargs):
...
register(my_check, Tags.security, deploy=True)
.. versionchanged:: 1.8
The ability to use register as a function was added.
.. _field-checking:
Field, Model, and Manager checks