(cls, django_user, couch_user, limit=10)
return list(map(_fmt_note, enumerate(notes)))
Returns notifications for a particular user

        After five notifications all notifications should be marked as read.
Returns notifications for a particular user
Returns notifications for a particular user
def get_by_user(cls, django_user, couch_user, limit=10):
        """Returns notifications for a particular user

        After five notifications all notifications should be marked as read.
        """
        notes = cls.objects.filter(Q(domain_specific=False) | Q(domains__overlap=couch_user.domains),
                                     is_active=True, activated__gt=django_user.date_joined)[:limit]
        read_notifications = set(cls.objects.filter(users_read=django_user).values_list('id', flat=True))

        def _fmt_note(note_idx):
            index = note_idx[0]
            note = note_idx[1]

            note_dict = {
                'id': note.id,
                'url': note.url,
                'date': '{dt:%B} {dt.day}'.format(dt=note.activated),
                'activated': note.activated,
                'content': note.content,
                'type': note.type,
                'isRead': (index > 4 or note.pk in read_notifications),
            }
            return note_dict

        return list(map(_fmt_note, enumerate(notes)))
def get_by_user ( cls , django_user , couch_user , limit = 10 ) : notes = cls . objects . filter ( Q ( domain_specific = False ) | Q ( domains__overlap = couch_user . domains ) , is_active = True , activated__gt = django_user . date_joined ) [ : limit ] read_notifications = set ( cls . objects . filter ( users_read = django_user ) . values_list ( 'id' , flat = True ) ) def _fmt_note ( note_idx ) : index = note_idx [ 0 ] note = note_idx [ 1 ] note_dict = { 'id' : note . id , 'url' : note . url , 'date' : '{dt:%B} {dt.day}' . format ( dt = note . activated ) , 'activated' : note . activated , 'content' : note . content , 'type' : note . type , 'isRead' : ( index > 4 or note . pk in read_notifications ) , } return note_dict return list ( map ( _fmt_note , enumerate ( notes ) ) )