2021-07-21 01:12:26 +00:00
|
|
|
from sqlalchemy import *
|
|
|
|
from flask import g
|
2021-07-22 19:19:49 +00:00
|
|
|
from drama.__main__ import Base
|
2021-07-21 01:12:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Image(Base):
|
|
|
|
__tablename__ = "images"
|
|
|
|
id = Column(BigInteger, primary_key=True)
|
|
|
|
state = Column(String(8))
|
|
|
|
number = Column(Integer)
|
|
|
|
text = Column(String(64))
|
|
|
|
deletehash = Column(String(64))
|
|
|
|
|
|
|
|
@property
|
|
|
|
def path(self):
|
|
|
|
return f"/assets/images/platy.jpg"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def random_image():
|
|
|
|
n=g.db.query(Image).count()
|
|
|
|
return g.db.query(Image).order_by(Image.id.asc()).first()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BadPic(Base):
|
|
|
|
|
|
|
|
#Class for tracking fuzzy hashes of banned csam images
|
|
|
|
|
|
|
|
__tablename__="badpics"
|
|
|
|
id = Column(BigInteger, primary_key=True)
|
2021-07-25 23:49:53 +00:00
|
|
|
description=Column(String(255))
|
2021-07-21 01:12:26 +00:00
|
|
|
phash=Column(String(64))
|
|
|
|
ban_reason=Column(String(64))
|
|
|
|
ban_time=Column(Integer)
|
|
|
|
|
|
|
|
|