Exemplo n.º 1
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = qs.select_related("project", "status", "assigned_to")

        if not self.request.QUERY_PARAMS.get('dashboard', False):
            qs = qs.select_related("milestone", "owner",
                                   "generated_from_issue",
                                   "generated_from_task")

            qs = qs.prefetch_related("assigned_users")
            include_attachments = "include_attachments" in self.request.QUERY_PARAMS
            include_tasks = "include_tasks" in self.request.QUERY_PARAMS

            epic_id = self.request.QUERY_PARAMS.get("epic", None)
            # We can be filtering by more than one epic so epic_id can consist
            # of different ids separete by comma. In that situation we will use
            # only the first
            if epic_id is not None:
                epic_id = epic_id.split(",")[0]

            qs = attach_extra_info(qs,
                                   user=self.request.user,
                                   include_attachments=include_attachments,
                                   include_tasks=include_tasks,
                                   epic_id=epic_id)
        return qs
Exemplo n.º 2
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = qs.select_related("milestone",
                               "project",
                               "status",
                               "owner",
                               "assigned_to",
                               "generated_from_issue")

        include_attachments = "include_attachments" in self.request.QUERY_PARAMS
        include_tasks = "include_tasks" in self.request.QUERY_PARAMS

        epic_id = self.request.QUERY_PARAMS.get("epic", None)
        # We can be filtering by more than one epic so epic_id can consist
        # of different ids separete by comma. In that situation we will use
        # only the first
        if epic_id is not None:
            epic_id = epic_id.split(",")[0]

        qs = attach_extra_info(qs, user=self.request.user,
                               include_attachments=include_attachments,
                               include_tasks=include_tasks,
                               epic_id=epic_id)

        return qs
Exemplo n.º 3
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = qs.select_related("milestone", "project", "status", "owner",
                               "assigned_to", "generated_from_issue")

        include_attachments = "include_attachments" in self.request.QUERY_PARAMS
        include_tasks = "include_tasks" in self.request.QUERY_PARAMS
        qs = attach_extra_info(qs,
                               user=self.request.user,
                               include_attachments=include_attachments,
                               include_tasks=include_tasks)

        return qs
Exemplo n.º 4
0
    def get_queryset(self):
        qs = super().get_queryset()
        qs = qs.select_related("milestone",
                               "project",
                               "status",
                               "owner",
                               "assigned_to",
                               "generated_from_issue")

        include_attachments = "include_attachments" in self.request.QUERY_PARAMS
        include_tasks = "include_tasks" in self.request.QUERY_PARAMS
        qs = attach_extra_info(qs, user=self.request.user,
                               include_attachments=include_attachments,
                               include_tasks=include_tasks)

        return qs