Skip to content

Conversation

steventlamb
Copy link
Contributor

In some cases, <queryset_instance>.model._meta.fields.verbose_name is
a unicode object as expected, like:
'name' or 'Name of User'

but other in cases, it is a python object representation, like:
<django.utils.functional.proxy object at 0xb2a82bac>

It is unclear why this is happening, but it turned up when trying to
export just the column headers of an empty queryset. By calling unicode,
it is forced to be the desired unicode object.

In some cases, <queryset_instance>.model._meta.fields.verbose_name is
a unicode object as expected, like:
'name' or 'Name of User'

but other in cases, it is a python object representation, like:
<django.utils.functional.__proxy__ object at 0xb2a82bac>

It is unclear why this is happening, but it turned up when trying to
export just the column headers of an empty queryset. By calling unicode,
it is forced to be the desired unicode object.
steventlamb pushed a commit that referenced this pull request Jan 27, 2014
…y_queryset

Force verbose_name to be a unicode object
@steventlamb steventlamb merged commit 2df3bc4 into azavea:master Jan 27, 2014
@steventlamb steventlamb deleted the topic/fix_python_repr_in_empty_queryset branch January 27, 2014 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant