def _get_favorites(request):
    """
    Gets the favorite articles' ids from request.user
    Input: request
    @return: <list> List of article ids
    """
    # rows = [{'id': 2}, {'id': 4} ... ]  (A list of article ids)
    rows = request.user.favorite_article.values('id')
    # favorites = [2, 4, ...] using list comprehension
    favorites = [row['id'] for row in rows]

    return favorites