summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ishtar_common/wizards.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index 114b47712..cffaac271 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -1253,19 +1253,24 @@ class DeletionWizard(Wizard):
if not self.current_obj:
return datas
res = {}
- for field in self.model._meta.fields + self.model._meta.many_to_many:
+ for field in self.model._meta.get_fields():
if field.name not in self.fields:
continue
value = getattr(self.current_obj, field.name)
if not value:
continue
+ label = ""
+ if hasattr(field, 'verbose_name'):
+ label = field.verbose_name
if hasattr(value, 'all'):
+ if not label and hasattr(field, 'related_model'):
+ label = field.related_model._meta.verbose_name_plural
value = ", ".join([unicode(item) for item in value.all()])
if not value:
continue
else:
value = unicode(value)
- res[field.name] = (field.verbose_name, value, '')
+ res[field.name] = (label, value, '')
if not datas and self.fields:
datas = [['', []]]
for field in self.fields: