val = getattr(obj, 'get_%s_display' % field.name)()
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
I think you can do what you want like this:
obj = queryset[my_item]
for field in obj._meta.fields:
if field.choices:
val = obj._get_FIELD_display(field)
else:
val = getattr(obj, field.name)
row.append(val)