Silver Library (Archived)
django - getlist 본문
반응형
What is this?
QueryDict.getlist(key, default=None)¶
Returns a list of the data with the requested key. Returns an empty list if the key doesn’t exist and default is None. It’s guaranteed to return a list unless the default value provided isn’t a list.
e.g.
>>> q = QueryDict('a=1', mutable=True)
>>> q.update({'a': '2'})
>>> q.getlist('a') ['1', '2']
>>> q['a'] # returns the last '2'
'Personal DB > Unclassified record' 카테고리의 다른 글
Django - all about URL (0) | 2021.01.12 |
---|---|
jango - render (0) | 2021.01.05 |
[django] pk? id? metadata? (0) | 2020.12.30 |
Caution - Django, space (0) | 2020.12.24 |
Django - class based view + function based view (0) | 2020.12.21 |