From 55fda6c9bd1cd304137e38e195e641f6b29116ce Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 30 Apr 2013 16:26:37 +0200 Subject: Add extra fields to Operation (fr specific) - many display improvment --- ishtar_common/models.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 61c7de7ff..8fcfacc9a 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -578,12 +578,10 @@ class Person(Address, OwnPerms) : ) def __unicode__(self): - lbl = u"%s %s" % (self.name, self.surname) - if self.attached_to: - lbl += settings.JOINT + unicode(self.attached_to) - elif self.email: - lbl += settings.JOINT + self.email - return lbl + values = [unicode(getattr(self, attr)) + for attr in ('surname', 'name', 'attached_to') + if getattr(self, attr)] + return u" ".join(values) def full_label(self): values = [] -- cgit v1.2.3 From 1f485dd4867dd48647ce46413b8a9bbb8065de4f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 30 Apr 2013 17:03:13 +0200 Subject: Add a default source type --- example_project/local_settings_nantes.py | 3 ++- example_project/settings.py | 2 +- ishtar_common/fixtures/initial_data.json | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'ishtar_common') diff --git a/example_project/local_settings_nantes.py b/example_project/local_settings_nantes.py index 96d47a409..1b9b9a537 100644 --- a/example_project/local_settings_nantes.py +++ b/example_project/local_settings_nantes.py @@ -112,7 +112,8 @@ ISHTAR_PERMIT_TYPES = { ISHTAR_DOC_TYPES = { 'RF':u"Rapport final", - 'RI':u"Rapport intermédiaire" + 'RI':u"Rapport intermédiaire", + "undefined":u"Non précisé" } # attrs, convert[, relative col number, multi] diff --git a/example_project/settings.py b/example_project/settings.py index d856fcce5..bfb59fb5d 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -161,7 +161,7 @@ ISHTAR_OPE_TYPES = {} # DB key: txt_idx ISHTAR_PERIODS = {} ISHTAR_PERMIT_TYPES = {} -ISHTAR_DOC_TYPES = {} +ISHTAR_DOC_TYPES = {u"undefined":u"Undefined"} ISHTAR_DPTS = [] diff --git a/ishtar_common/fixtures/initial_data.json b/ishtar_common/fixtures/initial_data.json index ba7a1e155..977881119 100644 --- a/ishtar_common/fixtures/initial_data.json +++ b/ishtar_common/fixtures/initial_data.json @@ -278,5 +278,15 @@ "txt_idx": "thematic_survey_report", "label": "Rapport de prospection th\u00e9matique" } + }, + { + "pk": 10, + "model": "ishtar_common.sourcetype", + "fields": { + "comment": "", + "available": true, + "txt_idx": "undefined", + "label": "Non pr\u00e9cis\u00e9" + } } ] -- cgit v1.2.3