20 lines
497 B
Python
20 lines
497 B
Python
from sqlalchemy import Column, String, Text
|
|
|
|
from tofu_api.common.database import Col
|
|
from tofu_api.common.database.mixins import TimestampMixin
|
|
from .base import BaseModel
|
|
|
|
|
|
class Task(TimestampMixin, BaseModel):
|
|
"""
|
|
Database model for tasks.
|
|
"""
|
|
|
|
__tablename__ = 'task'
|
|
|
|
title: Col[str] = Column(String(255), nullable=False)
|
|
description: Col[str] = Column(Text, nullable=False, default='')
|
|
|
|
def __repr__(self):
|
|
return self._repr(id=self.id, title=self.title)
|