'Get unread notifications with titles, humanized receiving time
and Mark-as-read links.'

def get_unread_notifs(self):

    notifs = []
    unread_notifs = Notification.query.filter_by(user=self, is_read=False).order_by(desc(Notification.received_at))
    for notif in unread_notifs:
        notifs.append({'title': notif.title, 'received_at': humanize.naturaltime((datetime.now(pytz.utc) - notif.received_at)), 'mark_read': url_for('notifications.mark_as_read', notification_id=notif.id)})
    return notifs
