MessageDecoder
Decode JSON that includes serialized Message instances.
Constructor
Signature
def MessageDecoder() - > null
Methods
process_messages()
@classmethod
def process_messages(
obj: any
) - > any
Recursively traverses a decoded JSON structure to identify and reconstruct Message instances from their serialized list format.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | any | The decoded JSON object, list, or primitive value to be inspected for message signatures. |
Returns
| Type | Description |
|---|---|
any | The processed object with serialized message lists replaced by Message instances and HTML content marked as safe where applicable. |
decode()
@classmethod
def decode(
s: string,
**kwargs: dict
) - > any
Decodes a JSON string into Python objects and then processes the result to restore any serialized Message instances.
Parameters
| Name | Type | Description |
|---|---|---|
| s | string | The JSON string to be decoded. |
| **kwargs | dict | Additional keyword arguments passed to the underlying JSONDecoder.decode method. |
Returns
| Type | Description |
|---|---|
any | The fully decoded Python object hierarchy with Message instances reconstructed. |