def METHOD_NAME(queryset, as_field="total_points_attr"):
    """Attach total of point values to each object of the queryset.
    :param queryset: A Django user stories queryset object.
    :param as_field: Attach the points as an attribute with this name.
    :return: Queryset object with the additional `as_field` field.
    """
    model = queryset.model
    sql = """SELECT SUM(projects_points.value)
                    FROM userstories_rolepoints
                    INNER JOIN projects_points ON userstories_rolepoints.points_id = projects_points.id
                    WHERE userstories_rolepoints.user_story_id = {tbl}.id"""
    sql = sql.format(tbl=model._meta.db_table)
    queryset = queryset.extra(select={as_field: sql})
    return queryset