from sqlalchemy import ForeignKey, Float from sqlalchemy import Column, Integer, String from sqlalchemy.ext.declarative import declarative_base BASE = declarative_base() class Task(BASE): __tablename__ = "task" id = Column(Integer, primary_key=True) parent_task_id = Column(Integer, ForeignKey('task.id')) name = Column(String) def __init__(self, parent_task_id, name): self.parent_task_id = parent_task_id self.name = name