diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 6ac197af4..98546c727 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1755,6 +1755,17 @@ class GenderedType(GeneralType): doc += ' "{}": {}'.format(key, label) return doc + def get_values(self, prefix='', **kwargs): + dct = { + prefix: self.label, + prefix + "id": self.pk, + prefix + "txt_idx": self.txt_idx, + prefix + "grammatical_gender": self.grammatical_gender + } + if prefix: + dct[prefix[:-1]] = self.label + return dct + class OrganizationType(GenderedType): class Meta: @@ -1983,14 +1994,8 @@ class TitleType(GenderedType): return doc def get_values(self, prefix='', **kwargs): - dct = { - prefix: self.label, - prefix + "id": self.pk, - prefix + "txt_idx": self.txt_idx, - prefix + "long_title": self.long_title - } - if prefix: - dct[prefix[:-1]] = self.label + dct = super(TitleType, self).get_values(prefix=prefix, **kwargs) + dct[prefix + "long_title"] = self.long_title return dct |