#33069: Comment to match code in django.form.widget.Widget.value_from_datadict
-----------------------------------------+------------------------
Reporter: Michael | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------
The comment says it returns `None` if not provided, maybe you are
expecting a default dict to be passed in as `data`, in which case this
ticket is invalid, but if it is a normal dict:
django/form/widget.py line 258 (class Widget):
{{{
def value_from_datadict(self, data, files, name):
"""
Given a dictionary of data and this widget's name, return the
value
of this widget or None if it's not provided.
"""
return data.get(name)
}}}
then either the comment needs to trim `or None if it's not provided` or
the code changed to `data.get(name, None)`
--
Ticket URL: <https://code.djangoproject.com/ticket/33069>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/053.64d7f9ff991992152eb6601820c59361%40djangoproject.com.