diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-12-28 01:15:07 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-05-06 15:38:32 +0200 |
commit | 086cb36acde4343f5e4dc8dc18a70cdbd8512c33 (patch) | |
tree | cf7782840ce79aee720cf3b6c55571ab0b2e7c8e /ishtar_common/models.py | |
parent | ee6a1eb3588da3c6c1c3f0e75691541cea2d37ab (diff) | |
download | Ishtar-086cb36acde4343f5e4dc8dc18a70cdbd8512c33.tar.bz2 Ishtar-086cb36acde4343f5e4dc8dc18a70cdbd8512c33.zip |
Work on dynamic (too much of ajax and JS...) person/organization widget
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 23c2f3ac7..fe907f014 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1540,10 +1540,13 @@ class Person(Address, Merge, OwnPerms, ValueGetter) : values = [unicode(getattr(self, attr)) for attr in ('surname', 'name') if getattr(self, attr)] - if not values: - values = [self.raw_name or ""] + if not values and self.raw_name: + values = [self.raw_name] if self.attached_to: - values.append(u"- " + unicode(self.attached_to)) + attached_to = unicode(self.attached_to) + if values: + values.append(u'-') + values.append(attached_to) return u" ".join(values) def get_values(self, prefix=''): @@ -1577,6 +1580,9 @@ class Person(Address, Merge, OwnPerms, ValueGetter) : self.merge_key += "-" + self.attached_to.merge_key self.merge_key = self.merge_key[:300] + def is_natural(self): + return not self.attached_to + def has_right(self, right_name): if '.' in right_name: right_name = right_name.split('.')[-1] |