Skip to content

Commit 4168127

Browse files
authored
[WEB-4999] feat: implement flexible data export utility with CSV, JSON, and XLSX support (#7884)
* feat: implement flexible data export utility with CSV, JSON, and XLSX support - Introduced Exporter class for handling various data formats. - Added formatters for CSV, JSON, and XLSX exports. - Created schemas for defining export fields and their transformations. - Implemented IssueExportSchema for exporting issue data with nested attributes. - Enhanced issue export task to utilize the new exporter system for better data handling. * feat: enhance issue export functionality with new relations and context handling - Updated issue export task to utilize new IssueRelation model for better relationship management. - Refactored Exporter class to accept QuerySets directly, improving performance and flexibility. - Enhanced IssueExportSchema to include parent issues and relations in the export. - Improved documentation for exporting multiple projects and filtering fields during export. * feat: enhance export functionality with field filtering and context support - Updated Exporter class to merge fields into options for formatting. - Modified formatters to filter fields based on specified options. - Enhanced ExportSchema to support optional field selection during serialization. - Improved documentation for the serialize method to clarify field filtering capabilities. * fixed type
1 parent 9dc14d8 commit 4168127

9 files changed

Lines changed: 1331 additions & 372 deletions

File tree

apps/api/plane/bgtasks/export_task.py

Lines changed: 41 additions & 372 deletions
Large diffs are not rendered by default.

apps/api/plane/db/models/issue.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,21 @@ class IssueRelationChoices(models.TextChoices):
273273
IMPLEMENTED_BY = "implemented_by", "Implemented By"
274274

275275

276+
# Bidirectional relation pairs: (forward, reverse)
277+
# Defined after class to avoid enum metaclass conflicts
278+
IssueRelationChoices._RELATION_PAIRS = (
279+
("blocked_by", "blocking"),
280+
("relates_to", "relates_to"), # symmetric
281+
("duplicate", "duplicate"), # symmetric
282+
("start_before", "start_after"),
283+
("finish_before", "finish_after"),
284+
("implemented_by", "implements"),
285+
)
286+
287+
# Generate reverse mapping from pairs
288+
IssueRelationChoices._REVERSE_MAPPING = {forward: reverse for forward, reverse in IssueRelationChoices._RELATION_PAIRS}
289+
290+
276291
class IssueRelation(ProjectBaseModel):
277292
issue = models.ForeignKey(Issue, related_name="issue_relation", on_delete=models.CASCADE)
278293
related_issue = models.ForeignKey(Issue, related_name="issue_related", on_delete=models.CASCADE)

0 commit comments

Comments
 (0)