mirror of
https://github.com/logos-co/open-law.git
synced 2025-01-10 06:46:04 +00:00
20 lines
495 B
Python
20 lines
495 B
Python
|
from app import db
|
||
|
from app.models.utils import BaseModel
|
||
|
|
||
|
|
||
|
class Tag(BaseModel):
|
||
|
__tablename__ = "tags"
|
||
|
|
||
|
name = db.Column(db.String(32), unique=True, nullable=False)
|
||
|
|
||
|
# Relationships
|
||
|
interpretations = db.relationship(
|
||
|
"Interpretation", secondary="interpretation_tags", back_populates="tags"
|
||
|
)
|
||
|
comments = db.relationship(
|
||
|
"Comment", secondary="comment_tags", back_populates="tags"
|
||
|
)
|
||
|
|
||
|
def __repr__(self):
|
||
|
return f"<{self.id}: {self.name}>"
|