summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-11-24 14:50:22 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2014-11-24 14:50:22 +0100
commit1094b07f381b658f8325c2723afa2e26b8909ebb (patch)
tree660816bc439f5387855dddacf7f6cf107c40de0a /ishtar_common/models.py
parent85732c3372a0667e5058929a124ef023850a8ca2 (diff)
downloadIshtar-1094b07f381b658f8325c2723afa2e26b8909ebb.tar.bz2
Ishtar-1094b07f381b658f8325c2723afa2e26b8909ebb.zip
Work on SRA importation
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)