From d658a3162fbeb68d148d1b2fcf4da4fe1437eddb Mon Sep 17 00:00:00 2001 From: Giannis Terzopoulos Date: Mon, 18 Mar 2024 14:50:32 +0100 Subject: Fixed #35233 -- Moved template engine system checks to backend methods. Thanks Adam Johnson for reviews. --- docs/topics/checks.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/checks.txt b/docs/topics/checks.txt index 3e3bbe19d6..94ba66f0db 100644 --- a/docs/topics/checks.txt +++ b/docs/topics/checks.txt @@ -130,18 +130,18 @@ The code below is equivalent to the code above:: .. _field-checking: -Field, model, manager, and database checks ------------------------------------------- +Field, model, manager, template engine, and database checks +----------------------------------------------------------- In some cases, you won't need to register your check function -- you can piggyback on an existing registration. -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. +Fields, models, model managers, template engines, 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. Consider an example where you are implementing a custom field named ``RangedIntegerField``. This field adds ``min`` and ``max`` arguments to the @@ -195,6 +195,10 @@ the only difference is that the check is a classmethod, not an instance method:: # ... your own checks ... return errors +.. versionchanged:: 5.1 + + In older versions, template engines didn't implement a ``check()`` method. + Writing tests ------------- -- cgit v1.3