|
@ -12,6 +12,7 @@ from sqlalchemy.orm import backref, relationship |
|
|
from sqlalchemy.sql.expression import text |
|
|
from sqlalchemy.sql.expression import text |
|
|
|
|
|
|
|
|
from tildes.enums import CommentLabelOption |
|
|
from tildes.enums import CommentLabelOption |
|
|
|
|
|
from tildes.metrics import incr_counter |
|
|
from tildes.models import DatabaseModel |
|
|
from tildes.models import DatabaseModel |
|
|
from tildes.models.user import User |
|
|
from tildes.models.user import User |
|
|
from .comment import Comment |
|
|
from .comment import Comment |
|
@ -62,6 +63,8 @@ class CommentLabel(DatabaseModel): |
|
|
self.weight = weight |
|
|
self.weight = weight |
|
|
self.reason = reason |
|
|
self.reason = reason |
|
|
|
|
|
|
|
|
|
|
|
incr_counter("comment_labels", label=label.name) |
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def name(self) -> str: |
|
|
def name(self) -> str: |
|
|
"""Return the name of the label (to avoid needing to do .label.name).""" |
|
|
"""Return the name of the label (to avoid needing to do .label.name).""" |
|
|