dev: state__group pagination

This commit is contained in:
pablohashescobar 2024-02-29 23:03:51 +05:30
parent ffeb77ec86
commit 144d47fdec
2 changed files with 17 additions and 1 deletions

View File

@ -131,6 +131,7 @@ def issue_on_results(issues, group_by):
"link_count",
"is_draft",
"archived_at",
"state__group",
]
if group_by == "assignees__id":
required_fields.extend(["label_ids", "module_ids", "assignees__id"])
@ -191,5 +192,19 @@ def issue_group_values(field, slug, project_id=None):
else:
return list(queryset) + ["None"]
if field == "priority":
return ["low", "medium", "high", "urgent", "none"]
return [
"low",
"medium",
"high",
"urgent",
"none",
]
if field == "state__group":
return [
"backlog",
"unstarted",
"started",
"completed",
"cancelled",
]
return []

View File

@ -325,6 +325,7 @@ class GroupedOffsetPaginator(OffsetPaginator):
def __query_grouper(self, results):
processed_results = self.__get_field_dict()
print(results)
for result in results:
group_value = str(result.get(self.group_by_field_name))
if group_value in processed_results: