Binary field. This is for storing ``bytes`` objects. Note that filter or queryset-update operations are not supported.
| 840 | |
| 841 | |
| 842 | class BinaryField(Field[T_BINARY], bytes): # type: ignore |
| 843 | """ |
| 844 | Binary field. |
| 845 | |
| 846 | This is for storing ``bytes`` objects. |
| 847 | Note that filter or queryset-update operations are not supported. |
| 848 | """ |
| 849 | |
| 850 | indexable = False |
| 851 | SQL_TYPE = "BLOB" |
| 852 | |
| 853 | @overload |
| 854 | def __init__( |
| 855 | self: BinaryField[bytes], *, null: Literal[False] = False, **kwargs: Any |
| 856 | ) -> None: ... |
| 857 | |
| 858 | @overload |
| 859 | def __init__( |
| 860 | self: BinaryField[bytes | None], *, null: Literal[True], **kwargs: Any |
| 861 | ) -> None: ... |
| 862 | |
| 863 | def __init__(self, **kwargs: Any) -> None: |
| 864 | super().__init__(**kwargs) |
| 865 | |
| 866 | class _db_postgres: |
| 867 | SQL_TYPE = "BYTEA" |
| 868 | |
| 869 | class _db_mysql: |
| 870 | SQL_TYPE = "LONGBLOB" |
| 871 | |
| 872 | class _db_mssql: |
| 873 | SQL_TYPE = "VARBINARY(MAX)" |
| 874 | |
| 875 | |
| 876 | class IntEnumFieldInstance(SmallIntField): |
no outgoing calls
searching dependent graphs…