forked from 00dani/lemoncurry
Ugh. Fix the new MessagePack serialiser to interface reliably with the msgpack library (gotta pass some flags and stuff) - also, actually depend on msgpack to make sure we have it
This commit is contained in:
parent
8d4444cfb9
commit
142e3eff2b
3 changed files with 21 additions and 5 deletions
|
@ -5,7 +5,7 @@ from django_redis.serializers.base import BaseSerializer
|
|||
|
||||
class MSGPackModernSerializer(BaseSerializer):
|
||||
def dumps(self, value):
|
||||
return msgpack.dumps(value)
|
||||
return msgpack.packb(value, use_bin_type=True)
|
||||
|
||||
def loads(self, value):
|
||||
return msgpack.loads(value)
|
||||
return msgpack.unpackb(value, raw=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue