comparison doc/upgrading.txt @ 8352:6ea309c6d17c

docs: fix registerutilMethod docs, format for highlights.
author John Rouillard <rouilj@ieee.org>
date Thu, 03 Jul 2025 12:30:21 -0400
parents 107761be1e75
children 226a4f391ae2
comparison
equal deleted inserted replaced
8351:e775cd258763 8352:6ea309c6d17c
432 * the form the user submitted 432 * the form the user submitted
433 433
434 you had to pass these objects from the template using the ``db``, 434 you had to pass these objects from the template using the ``db``,
435 ``request.client`` or ``request.form`` arguments. 435 ``request.client`` or ``request.form`` arguments.
436 436
437 A new method for registering a template utility has been 437 A new method for registering a template utility has been added. If you
438 added. If you use the ``instance`` object's 438 use the ``instance`` object's ``registerUtilMethod()`` to register a
439 ``registerUtilMethod()`` to register a utility function, you do 439 utility function, you do not need to pass these arguments. The
440 not need to pass these arguments. The function is called as a 440 function is called as a method and the first argument is a
441 method and the first argument is a ``client`` instance from which 441 TemplatingUtils (tu) instance from which the client object
442 the database (client.db), form (client.form). 442 (tu.client), the database (tu.client.db), form (tu.client.form),
443 request (tu.client.request), the translator for the current language
444 (tu._) and any functions (tu.X) you registered using
445 ``registerUtil()`` are available.
443 446
444 You can find an example in :ref:`dynamic_csp`. 447 You can find an example in :ref:`dynamic_csp`.
445 448
446 Directions for installing gpg 449 Directions for installing gpg
447 ----------------------------- 450 -----------------------------

Roundup Issue Tracker: http://roundup-tracker.org/