core/resolvers/rater.py

28 lines
545 B
Python
Raw Normal View History

2024-02-02 12:03:44 +00:00
from orm.reaction import ReactionKind
RATING_REACTIONS = [
ReactionKind.LIKE.value,
ReactionKind.ACCEPT.value,
ReactionKind.AGREE.value,
ReactionKind.DISLIKE.value,
ReactionKind.REJECT.value,
2024-02-02 12:59:22 +00:00
ReactionKind.DISAGREE.value,
]
2024-02-02 12:03:44 +00:00
def is_negative(x):
return x in [
ReactionKind.ACCEPT.value,
ReactionKind.LIKE.value,
ReactionKind.PROOF.value,
]
def is_positive(x):
return x in [
ReactionKind.ACCEPT.value,
ReactionKind.LIKE.value,
ReactionKind.PROOF.value,
]