Files
HangmanLab.Backend/db/models/Resource.py
2025-03-05 17:33:17 +00:00

16 lines
452 B
Python

from sqlalchemy import Column, Text, LargeBinary, String
from db.models import Base
class Resource(Base):
__tablename__ = 'resources'
id = Column(String(255), primary_key=True)
content = Column(LargeBinary, nullable=False)
data_type = Column(Text, nullable=False)
def to_dict(self):
return{
"id": self.id,
"data_type": self.data_type,
"content": self.content.decode('utf-8'),
}