"""Account model.""" from sqlalchemy import Column from sqlalchemy import Integer from sqlalchemy import String from moneyhub.models.mysql_base import BaseModel class Account(BaseModel): """Account model.""" __tablename__ = 'account' account_id = Column(Integer, nullable=False, primary_key=True) account_name = Column(String(32), nullable=True) @classmethod def exists(cls, account_id: int,) -> bool: """Check if a statement attachment already exists. Args: account_id (int): the label id Return: bool """ return bool(cls.query.filter(cls.account_id == account_id).first())