Re: [Django] #33069: Comment to match code in django.form.widget.Widget.value_from_datadict

2021-08-30 Thread Django
#33069: Comment to match code in django.form.widget.Widget.value_from_datadict
---+--
 Reporter:  Michael|Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  3.2
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  1  |UI/UX:  0
---+--
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 If works as documented with a dict, see
 [https://docs.python.org/3/library/stdtypes.html?highlight=dict#dict.get
 dict.get() docs].

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.e79b7b48f0bbacc880da7e93056af21c%40djangoproject.com.


[Django] #33069: Comment to match code in django.form.widget.Widget.value_from_datadict

2021-08-30 Thread Django
#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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.64d7f9ff991992152eb6601820c59361%40djangoproject.com.