Files
core/orm/rating.py

24 lines
773 B
Python
Raw Normal View History

2024-02-02 15:03:44 +03:00
from orm.reaction import ReactionKind
2024-04-09 14:03:50 +03:00
PROPOSAL_REACTIONS = [
2024-02-02 15:03:44 +03:00
ReactionKind.ACCEPT.value,
ReactionKind.REJECT.value,
2024-04-09 14:03:50 +03:00
ReactionKind.AGREE.value,
2024-02-02 15:59:22 +03:00
ReactionKind.DISAGREE.value,
2024-04-09 14:03:50 +03:00
ReactionKind.ASK.value,
ReactionKind.PROPOSE.value,
]
2024-04-17 18:32:23 +03:00
PROOF_REACTIONS = [ReactionKind.PROOF.value, ReactionKind.DISPROOF.value]
RATING_REACTIONS = [ReactionKind.LIKE.value, ReactionKind.DISLIKE.value]
2025-07-31 18:55:59 +03:00
POSITIVE_REACTIONS = [ReactionKind.ACCEPT.value, ReactionKind.LIKE.value, ReactionKind.PROOF.value]
NEGATIVE_REACTIONS = [ReactionKind.REJECT.value, ReactionKind.DISLIKE.value, ReactionKind.DISPROOF.value]
2024-02-02 15:03:44 +03:00
2025-07-31 18:55:59 +03:00
def is_negative(x: ReactionKind) -> bool:
return x.value in NEGATIVE_REACTIONS
2024-02-02 15:03:44 +03:00
2025-07-31 18:55:59 +03:00
def is_positive(x: ReactionKind) -> bool:
return x.value in POSITIVE_REACTIONS