class Photo(Model):
id = IntegerField()
idpost = IntegerField()
idwall = IntegerField()
# где находится - в посте или комментариях
where = CharField()
# бинарник фото
photobytes = BigBitField()
# photobytes = CharField()
# ссылка по которой скачивали фото
url = CharField()
# если она находится в комментариях
idcomment = IntegerField()
class Meta:
database = dbhandle
при запуске кода вылетаю в ошибку
Traceback (most recent call last):
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/fuckinggirl/PycharmProjects/untitled5/entity/photo.py", line 4, in
class Photo(Model):
File "/home/fuckinggirl/PycharmProjects/untitled5/venv/lib/python3.8/site-packages/peewee.py", line 6044, in __new__
cls._meta.add_field(name, field)
File "/home/fuckinggirl/PycharmProjects/untitled5/venv/lib/python3.8/site-packages/peewee.py", line 5833, in add_field
field.bind(self.model, field_name, set_attribute)
File "/home/fuckinggirl/PycharmProjects/untitled5/venv/lib/python3.8/site-packages/peewee.py", line 4617, in bind
self._db_hook(model._meta.database)
File "/home/fuckinggirl/PycharmProjects/untitled5/venv/lib/python3.8/site-packages/peewee.py", line 4609, in _db_hook
self._constructor = database.get_binary_type()
File "/home/fuckinggirl/PycharmProjects/untitled5/venv/lib/python3.8/site-packages/peewee.py", line 3773, in get_binary_type
return psycopg2.Binary
AttributeError: 'NoneType' object has no attribute 'Binary'
Process finished with exit code 1
Если же строку
photobytes = BigBitField()
меняю например на
photobytes = CharField()
то все работает норм. В чем может быть ошибка?