MCPcopy
hub / github.com/django/django / setlistdefault

Method setlistdefault

django/utils/datastructures.py:166–173  ·  view source on GitHub ↗
(self, key, default_list=None)

Source from the content-addressed store, hash-verified

164 return self[key]
165
166 def setlistdefault(self, key, default_list=None):
167 if key not in self:
168 if default_list is None:
169 default_list = []
170 self.setlist(key, default_list)
171 # Do not return default_list here because setlist() may store
172 # another value -- QueryDict.setlist() does. Look it up.
173 return self._getlist(key)
174
175 def appendlist(self, key, value):
176 """Append an item to the internal list associated with key."""

Callers 3

appendlistMethod · 0.95
updateMethod · 0.95
test_multivaluedictMethod · 0.95

Calls 2

setlistMethod · 0.95
_getlistMethod · 0.95

Tested by 1

test_multivaluedictMethod · 0.76