diff options
| author | Swann <swann.bouviermuller@gmail.com> | 2022-01-06 15:34:31 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-06-03 12:19:47 +0200 |
| commit | d0863429a39dbc99a52a6d781006e7075c743d33 (patch) | |
| tree | 6ecd81afa8d7020c058542f97872890df5c83c26 /django/forms/widgets.py | |
| parent | 286e7d076cfb7b4b0bdfc917de3020e6e89683f6 (diff) | |
Fixed documentation of Widget.id_for_label() empty return value.
Diffstat (limited to 'django/forms/widgets.py')
| -rw-r--r-- | django/forms/widgets.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index fffa7430fc..71f2710a2b 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -301,8 +301,8 @@ class Widget(metaclass=MediaDefiningClass): def id_for_label(self, id_): """ - Return the HTML ID attribute of this Widget for use by a <label>, - given the ID of the field. Return None if no ID is available. + Return the HTML ID attribute of this Widget for use by a <label>, given + the ID of the field. Return an empty string if no ID is available. This hook is necessary because some widgets have multiple HTML elements and, thus, multiple IDs. In that case, this method should |
