Esempio n. 1
0
def get_num(user):
    if not user.is_authenticated():
        return 0
    return len(BaseNotification.by_receiver(user, read=False, deleted=False))
Esempio n. 2
0
def get_num(user):
    if not user.is_authenticated():
        return 0
    return len(BaseNotification.by_receiver(user, read=False, deleted=False))
Esempio n. 3
0
def get_notifications(user):
    if not user.is_authenticated():
        return []
    return BaseNotification.by_receiver(user, deleted=False).order_by('-date')
Esempio n. 4
0
def get_notifications(user):
    if not user.is_authenticated():
        return []
    return BaseNotification.by_receiver(user, deleted=False).order_by('-date')