Example #1
0
def attach_extra_info(queryset,
                      user=None,
                      include_attachments=False,
                      include_tasks=False,
                      epic_id=None):
    queryset = attach_total_points(queryset)
    queryset = attach_role_points(queryset)
    queryset = attach_epics(queryset)

    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    if include_tasks:
        queryset = attach_tasks(queryset)
        queryset = queryset.extra(select={"include_tasks": "True"})

    if epic_id is not None:
        queryset = attach_epic_order(queryset, epic_id)
        queryset = queryset.extra(select={"include_epic_order": "True"})

    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    queryset = attach_total_comments_to_queryset(queryset)
    return queryset
Example #2
0
def attach_extra_info(queryset, user=None, include_attachments=False, include_tasks=False, epic_id=None):
    queryset = attach_total_points(queryset)
    queryset = attach_role_points(queryset)
    queryset = attach_epics(queryset)

    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    if include_tasks:
        queryset = attach_tasks(queryset)
        queryset = queryset.extra(select={"include_tasks": "True"})

    if epic_id is not None:
        queryset = attach_epic_order(queryset, epic_id)
        queryset = queryset.extra(select={"include_epic_order": "True"})

    queryset = attach_total_attachments(queryset)
    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    queryset = attach_total_comments_to_queryset(queryset)
    return queryset
Example #3
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = self.attach_votes_attrs_to_queryset(qs)
        qs = qs.select_related("milestone", "project", "status", "owner",
                               "assigned_to")

        qs = self.attach_watchers_attrs_to_queryset(qs)
        if "include_attachments" in self.request.QUERY_PARAMS:
            qs = attach_basic_attachments(qs)
            qs = qs.extra(select={"include_attachments": "True"})

        return qs
Example #4
0
def attach_extra_info(queryset, user=None, include_attachments=False):
    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    queryset = attach_generated_user_stories(queryset)
    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    return queryset
Example #5
0
def attach_extra_info(queryset, user=None, include_attachments=False):
    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    queryset = attach_user_stories_counts_to_queryset(queryset)
    queryset = attach_child_epics_counts_to_queryset(queryset)
    queryset = attach_epic_progress_to_queryset(queryset)
    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    return queryset
Example #6
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = self.attach_votes_attrs_to_queryset(qs)
        qs = qs.select_related("milestone",
                               "project",
                               "status",
                               "owner",
                               "assigned_to")

        qs = self.attach_watchers_attrs_to_queryset(qs)
        if "include_attachments" in self.request.QUERY_PARAMS:
            qs = attach_basic_attachments(qs)
            qs = qs.extra(select={"include_attachments": "True"})

        return qs
Example #7
0
def attach_extra_info(queryset, user=None, include_attachments=False, include_tasks=False):
    queryset = attach_total_points(queryset)
    queryset = attach_role_points(queryset)

    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    if include_tasks:
        queryset = attach_tasks(queryset)
        queryset = queryset.extra(select={"include_tasks": "True"})

    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    return queryset
Example #8
0
def attach_extra_info(queryset, user=None, include_attachments=False, include_tasks=False):
    queryset = attach_total_points(queryset)
    queryset = attach_role_points(queryset)

    if include_attachments:
        queryset = attach_basic_attachments(queryset)
        queryset = queryset.extra(select={"include_attachments": "True"})

    if include_tasks:
        queryset = attach_tasks(queryset)
        queryset = queryset.extra(select={"include_tasks": "True"})

    queryset = attach_total_voters_to_queryset(queryset)
    queryset = attach_watchers_to_queryset(queryset)
    queryset = attach_total_watchers_to_queryset(queryset)
    queryset = attach_is_voter_to_queryset(queryset, user)
    queryset = attach_is_watcher_to_queryset(queryset, user)
    return queryset