mirror of
https://github.com/neogeek23/drawshare.git
synced 2026-02-04 11:08:21 +00:00
19 lines
394 B
Python
19 lines
394 B
Python
import pickle
|
|
|
|
from django.core.signing import JSONSerializer as BaseJSONSerializer
|
|
|
|
|
|
class PickleSerializer:
|
|
"""
|
|
Simple wrapper around pickle to be used in signing.dumps and
|
|
signing.loads.
|
|
"""
|
|
def dumps(self, obj):
|
|
return pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)
|
|
|
|
def loads(self, data):
|
|
return pickle.loads(data)
|
|
|
|
|
|
JSONSerializer = BaseJSONSerializer
|