(self, binary_compression: bool = True, **kwargs: Any)
| 32 | SQL_TYPE = "CHAR(36)" |
| 33 | |
| 34 | def __init__(self, binary_compression: bool = True, **kwargs: Any) -> None: |
| 35 | if (kwargs.get("primary_key") or kwargs.get("pk", False)) and "default" not in kwargs: |
| 36 | kwargs["default"] = uuid4 |
| 37 | super().__init__(**kwargs) |
| 38 | |
| 39 | if binary_compression: |
| 40 | self.SQL_TYPE = "BINARY(16)" |
| 41 | self._binary_compression = binary_compression |
| 42 | |
| 43 | def to_db_value(self, value: Any, instance: type[Model] | Model) -> str | bytes | None: # type: ignore |
| 44 | # Make sure that value is a UUIDv4 |