Exemplo n.º 1
0
def CommentAttitude_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, CommentAttitude):
        mMs.CounterOperate(instance.ObjectID, 'Like' if instance.Point == 1 else 'Dislike', '+')
        mMs.AddNotification('CAL' if instance.Point == 1 else 'CAD', instance.ObjectID, instance.Publisher, instance.ObjectID.Publisher)
    elif (not created) and isinstance(instance, CommentAttitude):
        mMs.CounterOperate(instance.ObjectID, 'Like' if int(instance.Point) == 1 else 'Dislike', '+')
        mMs.CounterOperate(instance.ObjectID, 'Like' if abs(int(instance.Point) - 1) == 1 else 'Dislike', '-')
        mMs.AddNotification('CAL' if instance.Point == 1 else 'CAD', instance.ObjectID, instance.Publisher, instance.ObjectID.Publisher)
Exemplo n.º 2
0
def comment_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, CommentInfo):
        mMs.CounterOperate(instance.TopicID, 'Comment', '+')
        mMs.CounterOperate(
            instance.Publisher, 'TRCount' if instance.TopicID.Type == 'Topic' else 'SRCount', '+')
        if instance.TopicID.Type == 'Topic':
            mMs.AddNotification('TCR' if instance.Parent else 'TC', instance, instance.Publisher, instance.Parent.Publisher if instance.Parent else instance.TopicID.Publisher)
        else:
            mMs.AddNotification('SCR' if instance.Parent else 'SC', instance, instance.Publisher, instance.Parent.Publisher if instance.Parent else instance.TopicID.Publisher)
Exemplo n.º 3
0
def circusee_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, Circusee):
        mMs.CounterOperate(instance.ObjectID, 'Collect', '+')
Exemplo n.º 4
0
def concern_delete(sender, instance, **kwargs):
    if isinstance(instance, Concern):
        mMs.CounterOperate(instance.ObjectID, 'Collect', '-')
Exemplo n.º 5
0
def concern_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, Concern):
        mMs.CounterOperate(instance.ObjectID, 'Collect', '+')
Exemplo n.º 6
0
def comment_delete(sender, instance, **kwargs):
    if isinstance(instance, CommentInfo):
        mMs.CounterOperate(instance.TopicID, 'Comment', '-')
        mMs.CounterOperate(
            instance.Publisher, 'TRCount' if instance.Type == 'Topic' else 'SRCount', '-')
Exemplo n.º 7
0
def rollcalldialogue_delete(sender, instance, **kwargs):
    if isinstance(instance, RollCallDialogue):
        mMs.CounterOperate(instance.RollCallID, 'Comment', '-')
        mMs.CounterOperate(instance.Publisher, 'RRCount', '-')
Exemplo n.º 8
0
def rollcalldialogue_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, RollCallDialogue):
        mMs.CounterOperate(instance.RollCallID, 'Comment', '+')
        mMs.CounterOperate(instance.Publisher, 'RRCount', '+')
        if not instance.RollCallID.Publisher == instance.Publisher:
            mMs.AddNotification('RD', instance.RollCallID, instance.Publisher, instance.RollCallID.Target)
Exemplo n.º 9
0
def rollcall_delete(sender, instance, **kwargs):
    if isinstance(instance, RollCallInfo):
        mMs.CounterOperate(instance.Publisher, 'RCount', '-')
Exemplo n.º 10
0
def rollcall_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, RollCallInfo):
        mMs.CounterOperate(instance.Publisher, 'RCount', '+')
        mMs.AddNotification('R', instance, instance.Publisher, instance.Target)
Exemplo n.º 11
0
def topic_delete(sender, instance, **kwargs):
    if isinstance(instance, TopicInfo):
        mMs.CounterOperate(
            instance.Publisher, 'TCount' if instance.Type == 'Topic' else 'SCount', '-')
Exemplo n.º 12
0
def CommentAttitude_delete(sender, instance, **kwargs):
    if isinstance(instance, CommentAttitude):
        mMs.CounterOperate(instance.ObjectID, 'Like' if int(instance.Point) == 1 else 'Dislike', '-')
Exemplo n.º 13
0
def topic_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, TopicInfo):
        mMs.CounterOperate(
            instance.Publisher, 'TCount' if instance.Type == 'Topic' else 'SCount', '+')
        for item in QRC('UserLink.objects.filter(UserBeLinked=%s)', None, instance.Publisher):
            mMs.AddNotification('TP' if instance.Type == 'Topic' else 'SP', instance, instance.Publisher, item.UserLinking)
Exemplo n.º 14
0
def userlink_delete(sender, instance, **kwargs):
    if isinstance(instance, UserLink):
        mMs.CounterOperate(instance.UserBeLinked, 'FansCount', '-')
        mMs.CounterOperate(instance.UserLinking, 'FocusCount', '-')
Exemplo n.º 15
0
def userlink_create(sender, instance, created, **kwargs):
    if created and isinstance(instance, UserLink):
        mMs.CounterOperate(instance.UserBeLinked, 'FansCount', '+')
        mMs.CounterOperate(instance.UserLinking, 'FocusCount', '+')
        mMs.AddNotification('L', instance, instance.UserLinking, instance.UserBeLinked)
Exemplo n.º 16
0
def circusee_delete(sender, instance, **kwargs):
    if isinstance(instance, Circusee):
        mMs.CounterOperate(instance.ObjectID, 'Collect', '-')