def unseen_notices(request):
    """
    return a list of unseen notices for current user
    """
    if request.user.is_authenticated():
        qs = Notice.notices_for(request.user, unseen=True)
        return {'unseen_notices': qs}
    else:
        return {}
示例#2
0
 def get_queryset(self):
     """
     return notice list for the current user
     """
     return Notice.notices_for(self.request.user)