MCPcopy
hub / github.com/django/django / get

Method get

django/utils/datastructures.py:118–129  ·  view source on GitHub ↗

Return the last data value for the passed key. If key doesn't exist or value is an empty list, return `default`.

(self, key, default=None)

Source from the content-addressed store, hash-verified

116 self.__dict__.update(obj_dict)
117
118 def get(self, key, default=None):
119 """
120 Return the last data value for the passed key. If key doesn't exist
121 or value is an empty list, return `default`.
122 """
123 try:
124 val = self[key]
125 except KeyError:
126 return default
127 if val == []:
128 return default
129 return val
130
131 def _getlist(self, key, default=None, force_list=False):
132 """

Callers 15

test_multivaluedictMethod · 0.95
latest_post_dateMethod · 0.45
add_item_elementsMethod · 0.45
phone2numericFunction · 0.45
emitMethod · 0.45
tickMethod · 0.45
__init__Method · 0.45
_watch_rootMethod · 0.45
_check_subscriptionMethod · 0.45
run_with_reloaderFunction · 0.45
get_formatFunction · 0.45
nonce_attrFunction · 0.45

Calls

no outgoing calls

Tested by 1

test_multivaluedictMethod · 0.76