Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_as_xls #49

Closed
xfuren opened this issue Feb 25, 2014 · 2 comments
Closed

export_as_xls #49

xfuren opened this issue Feb 25, 2014 · 2 comments

Comments

@xfuren
Copy link

xfuren commented Feb 25, 2014

header = [unicode(f.verbose_name) for f in queryset.model._meta.fields if f.name in fields]
is no good when the fields not in the original order, consider
header = [queryset.model._meta.get_field_by_name(f)[0].verbose_name for f in fields]

Please consider add a option for usedisplay=True during calling get_field_value in export_as_xls . Sometimes we want to get the display value rather than the raw value.

Thanks

Furen

@asfaltboy
Copy link
Contributor

Hi @xfuren, just my opinion here, but the first point is not necessary. With the current way base_export works. The initial data for the pre-export form is set like so:

cols = [(f.name, f.verbose_name) for f in queryset.model._meta.fields]

This means that the only order the fields may appear is as they appear in the (ordered) list Model._meta.fields

For your second point, I agree and intend to submit the pull request which will allow "usedisplay" as well as selecting the date/datetime formatting for the exported xls (same as with csv), and converting relation field values to a string (issue #51).

@saxix
Copy link
Owner

saxix commented Sep 22, 2014

0.7 introduce usedisplay checkbox in the form (thx @bugman80 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants