MCPcopy
hub / github.com/django/django / _encode

Method _encode

django/contrib/messages/storage/cookie.py:188–196  ·  view source on GitHub ↗

Return an encoded version of the messages list which can be stored as plain text. Proxies MessagePartSerializer.dumps and _encoded_parts.

(self, messages, encode_empty=False)

Source from the content-addressed store, hash-verified

186 )
187
188 def _encode(self, messages, encode_empty=False):
189 """
190 Return an encoded version of the messages list which can be stored as
191 plain text.
192
193 Proxies MessagePartSerializer.dumps and _encoded_parts.
194 """
195 serialized_messages = MessagePartSerializer().dumps(messages)
196 return self._encode_parts(serialized_messages, encode_empty=encode_empty)
197
198 def _decode(self, data):
199 """

Callers 3

set_cookie_dataFunction · 0.80
encode_decodeMethod · 0.80
test_message_rfc6265Method · 0.80

Calls 3

_encode_partsMethod · 0.95
dumpsMethod · 0.45

Tested by 3

set_cookie_dataFunction · 0.64
encode_decodeMethod · 0.64
test_message_rfc6265Method · 0.64