diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-03-19 12:15:09 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-04-08 20:28:00 +0200 |
| commit | 0d3c616fbb2f49fa7ff6809e5a6777275352b35b (patch) | |
| tree | e444996e32456a0ab64f65ee76e1d0c110f25ff5 /docs | |
| parent | 5ac7c8f7ab2b2e1fec50abb14539a2eb520d1995 (diff) | |
Refs #26351 -- Added check hook to support database-related checks
Thanks Tim Graham and Shai Berger for the reviews.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/checks.txt | 8 | ||||
| -rw-r--r-- | docs/topics/checks.txt | 19 |
2 files changed, 20 insertions, 7 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt index c82bd2bc98..a332df2071 100644 --- a/docs/ref/checks.txt +++ b/docs/ref/checks.txt @@ -84,6 +84,14 @@ Django's system checks are organized using the following tags: * ``templates``: Checks template related configuration. * ``caches``: Checks cache related configuration. * ``urls``: Checks URL configuration. +* ``database``: Checks database-related configuration issues. Database checks + are not run by default because they do more than static code analysis as + regular checks do. They are only run by the :djadmin:`migrate` command or if + you specify the ``database`` tag when calling the :djadmin:`check` command. + +.. versionadded:: 1.10 + + The ``database`` tag was added. Some checks may be registered with multiple tags. diff --git a/docs/topics/checks.txt b/docs/topics/checks.txt index a019caa7c6..355e85714e 100644 --- a/docs/topics/checks.txt +++ b/docs/topics/checks.txt @@ -120,17 +120,22 @@ The code below is equivalent to the code above:: .. _field-checking: -Field, model, and manager checks --------------------------------- +Field, model, manager, and database checks +------------------------------------------ In some cases, you won't need to register your check function -- you can piggyback on an existing registration. -Fields, models, and model managers all implement a ``check()`` method that is -already registered with the check framework. If you want to add extra checks, -you can extend the implementation on the base class, perform any extra -checks you need, and append any messages to those generated by the base class. -It's recommended that you delegate each check to separate methods. +Fields, models, model managers, and database backends all implement a +``check()`` method that is already registered with the check framework. If you +want to add extra checks, you can extend the implementation on the base class, +perform any extra checks you need, and append any messages to those generated +by the base class. It's recommended that you delegate each check to separate +methods. + +.. versionchanged:: 1.10 + + Database backend checks were added. Consider an example where you are implementing a custom field named ``RangedIntegerField``. This field adds ``min`` and ``max`` arguments to the |
