summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index f77c4f980..a96b24840 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -875,7 +875,10 @@ class Person(Address, OwnPerms, ValueGetter) :
title = models.CharField(_(u"Title"), max_length=2, choices=TYPE)
surname = models.CharField(_(u"Surname"), max_length=50, blank=True,
null=True)
- name = models.CharField(_(u"Name"), max_length=200)
+ name = models.CharField(_(u"Name"), max_length=200, blank=True,
+ null=True)
+ raw_name = models.CharField(_(u"Raw name"), max_length=300, blank=True,
+ null=True)
person_types = models.ManyToManyField(PersonType, verbose_name=_(u"Types"))
attached_to = models.ForeignKey('Organization', related_name='members',
on_delete=models.SET_NULL,
@@ -896,6 +899,8 @@ class Person(Address, OwnPerms, ValueGetter) :
values = [unicode(getattr(self, attr))
for attr in ('surname', 'name')
if getattr(self, attr)]
+ if not values:
+ values = [self.raw_name]
if self.attached_to:
values.append(u"- " + unicode(self.attached_to))
return u" ".join(values)