예제 #1
0
def messages(request):
    """Add context variables related to ``messages`` app"""
    count = 0
    ctx = {}
    if request.user.is_authenticated():
        key = 'message-count-%s' % request.user.pk
        #count = cache.get(key)
        count = None
        if count is None:
            count = inbox_count_for(request.user)
            cache.set(key, count)
    ctx['UNREAD_MESSAGE_COUNT'] = count
    return ctx
예제 #2
0
파일: forum_extras.py 프로젝트: lite/djsite
def pm_unreads(user):
    return inbox_count_for(user)
예제 #3
0
def pm_unreads(user):
    if forum_settings.PM_SUPPORT:
        return inbox_count_for(user)
    return None
예제 #4
0
def inbox(request):
    if request.user.is_authenticated:
        return {'messages_inbox_count': inbox_count_for(request.user)}
    else:
        return {}
예제 #5
0
파일: forum_extras.py 프로젝트: lite/djsite
def pm_unreads(user):
    return inbox_count_for(user)
예제 #6
0
def inbox(request):
    if request.user.is_authenticated():
        return {'messages_inbox_count': inbox_count_for(request.user)}
    else:
        return {}
예제 #7
0
def pm_unreads(user):
    if forum_settings.PM_SUPPORT:
        return inbox_count_for(user)
    return None