You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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).
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
The text was updated successfully, but these errors were encountered: