django-mongoengine icon indicating copy to clipboard operation
django-mongoengine copied to clipboard

Usage with django_tables2

Open hdzierz opened this issue 8 years ago • 1 comments

I encountered a wee problem with using django_tables2. When passing an array of documents into the table from a queryset the column headings fall back to the default for verbose_name (None). I think the reason could be this part of the DjangoField constructor:

if self.verbose_name is None and self.name:
            self.verbose_name = self.name.replace('_', ' ')

self.verbose_name will never be set as self.name is undefined at that stage.

Does that make sense?

Cheers

hdzierz avatar Oct 18 '16 01:10 hdzierz

I don't think so, but i was writing that code for django 1.9, maybe something was changed. Try to insert some logging and debug it (or use pdb/ipdb)

last-partizan avatar Oct 18 '16 11:10 last-partizan