MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / __set__

Method __set__

mongoengine/fields.py:1565–1569  ·  view source on GitHub ↗

Handle bytearrays in python 3.1

(self, instance, value)

Source from the content-addressed store, hash-verified

1563 super().__init__(**kwargs)
1564
1565 def __set__(self, instance, value):
1566 """Handle bytearrays in python 3.1"""
1567 if isinstance(value, bytearray):
1568 value = bytes(value)
1569 return super().__set__(instance, value)
1570
1571 def to_mongo(self, value):
1572 return Binary(value)

Callers

nothing calls this directly

Calls 1

__set__Method · 0.45

Tested by

no test coverage detected