diff options
| -rw-r--r-- | archaeological_operations/models.py | 2 | ||||
| -rw-r--r-- | example_project/settings.py | 2 | ||||
| -rw-r--r-- | ishtar_common/ooo_replace.py | 7 | 
3 files changed, 9 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 04ad867fc..125a5d7d1 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -416,7 +416,7 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter):          filename = ''          if operation and self.operation:              filename = self.operation.associated_filename -        else: +        elif self.associated_file:              filename = self.associated_file.associated_filename          filename = u"-".join(filename.split('-')[:-1]) # remove date          if self.act_type.code: diff --git a/example_project/settings.py b/example_project/settings.py index 1e9051429..753c21a07 100644 --- a/example_project/settings.py +++ b/example_project/settings.py @@ -45,6 +45,8 @@ LANGUAGE_CODE = 'fr-fr'  COUNTRY = "fr" +DATE_FORMAT = u"%-d %B %Y" +  SITE_ID = 1  # If you set this to False, Django will make some optimizations so as not diff --git a/ishtar_common/ooo_replace.py b/ishtar_common/ooo_replace.py index 2158bb473..d929d9359 100644 --- a/ishtar_common/ooo_replace.py +++ b/ishtar_common/ooo_replace.py @@ -63,7 +63,12 @@ def _format_value(value, default_value):          c_locale = "_".join(c_locale)          if locale.getlocale()[0] != c_locale:              locale.setlocale(locale.LC_ALL, c_locale) -        value = value.strftime('%x') +        if settings.DATE_FORMAT: +            value = unicode(value.strftime(settings.DATE_FORMAT).decode( +                                            locale.getlocale()[1]).lower()) +        else: +            value = unicode(value.strftime('%x').decode( +                                            locale.getlocale()[1]))      value = unicode(value) if value else default_value      return value  | 
