From fbb89b1bffd90745d8cc155eb0370ebdb1ab02e0 Mon Sep 17 00:00:00 2001 From: Nico Zanferrari Date: Tue, 5 Nov 2024 22:52:29 +0100 Subject: [PATCH] DOCS: deprecate DAL widgets and clarify grid.action --- docs/chapter-07.rst | 4 +++- docs/chapter-12.rst | 5 +++++ docs/chapter-14.rst | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/chapter-07.rst b/docs/chapter-07.rst index f979e3dc..37da50b1 100644 --- a/docs/chapter-07.rst +++ b/docs/chapter-07.rst @@ -1055,9 +1055,11 @@ only for fields of type “string”. ``uploadfield``, ``authorize``, and - ``authorize`` can be used to require access control on the corresponding field, for “upload” fields only. It will be discussed more in detail in the context of Authentication and Authorization. +- ``widget`` do not use DAL widgets with py4web, it has has its own + (see :ref:`Widgets` later). - ``represent`` can be None or can point to a function that takes a field value and returns an alternate representation for the field - value. Examples: + value. Note not all the attributes are thread safe and most of them should only be set globally for an app. The following are guaranteed to be diff --git a/docs/chapter-12.rst b/docs/chapter-12.rst index f08a361d..40a9d661 100644 --- a/docs/chapter-12.rst +++ b/docs/chapter-12.rst @@ -343,6 +343,11 @@ dropdown menu! Using widgets in forms is quite easy, and they'll let you have more control on its pieces. +.. important:: + + When using py4web, use py4web widgets, and do not use the pydal widget argument in the Field object + (see :ref:`Field constructor`). + Custom widgets ~~~~~~~~~~~~~~ diff --git a/docs/chapter-14.rst b/docs/chapter-14.rst index a80d87fd..cff86a08 100644 --- a/docs/chapter-14.rst +++ b/docs/chapter-14.rst @@ -366,7 +366,7 @@ the grid or a form. Use the following to decide: :: - [[if request.query.get('action') in ('details', 'edit'):]] + [[if grid.action in ['details', 'edit']: ]] # Display the custom form [[form = grid.render() ]] [[form.custom["begin"] ]]