Edgewall Software
Modify

Opened 10 years ago

Closed 8 years ago

#11762 closed enhancement (fixed)

[PATCH] Use column label when exporting to CSV

Reported by: tweksteen Owned by: Ryan J Ollos
Priority: low Milestone: 1.2
Component: query system Version: 1.1dev
Severity: minor Keywords: patch csv
Cc: Branch:
Release Notes:

Column labels are used when exporting query results to CSV. The labels are not translated.

API Changes:
Internal Changes:

Description

This patch uses the column label instead of name when exporting to CSV.

Attachments (1)

add_label_to_csv_export.diff (1.4 KB ) - added by tweksteen 10 years ago.

Download all attachments as: .zip

Change History (14)

by tweksteen, 10 years ago

comment:1 by Jun Omae, 10 years ago

Component: generalquery system
Keywords: csv added

I think that csv from report view should keep original labels because SQL statements in report system have labels. See tags/trac-1.1.1/trac/ticket/report.py@:766#L765

Last edited 10 years ago by Jun Omae (previous) (diff)

comment:2 by Christian Boos, 10 years ago

Milestone: next-dev-1.1.x
Priority: normallow
Severity: normalminor

So yes, maybe for the query view.

Care to update the patch and adapt the tests? I doubt they'll pass with this change… and if so, it means we don't have yet tests for that and you probably should add one!

comment:3 by Ryan J Ollos, 10 years ago

Milestone: next-dev-1.1.xnext-major-releases

Retargetting tickets to narrow focus for milestone:1.2. Please move the ticket back to milestone:next-dev-1.1.x if you intend to resolve it by milestone:1.2.

comment:4 by figaro, 9 years ago

Keywords: patch added

comment:5 by Ryan J Ollos, 9 years ago

#12481 closed as a duplicate.

comment:6 by Ryan J Ollos, 9 years ago

Milestone: next-major-releases1.0.12
Owner: set to Ryan J Ollos
Status: newassigned

comment:7 by Jun Omae, 9 years ago

Csv export can be used to import via th:TicketImportPlugin. I don't think we should always use field's labels for the export. If such a import plugin understands field's labels when importing, it couldn't detect fields when fields have same label.

I think we should add option for the feature and/or the milestone should be 1.2.

comment:8 by Ryan J Ollos, 9 years ago

Milestone: 1.0.121.2

If the issue is simply a matter of compatibility with existing plugins, I'd rather move to milestone:1.2 instead of adding an option.

comment:9 by Jun Omae, 9 years ago

Another thing: the lables in export would be localized after the patch.

comment:10 by Ryan J Ollos, 9 years ago

I guess that, on the one hand it would be good to localize the labels so that the exported content matches what is shown on the Query page. On the other hand, I can see how that would be bad for export/import of the data. We could disable translations like is done in the ticket notifications: tags/trac-1.0.11/trac/ticket/notification.py@:263#L249.

It might be worth considering a way to translate the labels by default while having a query parameter that allows disabling translations for use with the TicketImportPlugin.

comment:11 by Ryan J Ollos, 9 years ago

Changes for consideration: [6c89b953/rjollos.git].

comment:12 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)

comment:13 by Ryan J Ollos, 8 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [14788].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.