diff options
| author | root <root@viserion.(none)> | 2013-07-05 10:20:46 +0000 | 
|---|---|---|
| committer | root <root@viserion.(none)> | 2013-07-05 10:20:46 +0000 | 
| commit | 631267163d86ef506a6e23707024713265756d04 (patch) | |
| tree | 188c5535a4f0857d388bb962401817df70877434 /archaeological_operations/import_from_csv.py | |
| parent | 1071b0ea86537922d791687f212e3db4e943af94 (diff) | |
| parent | cc7043b301e484ef439e9e7194765a8656e8a02e (diff) | |
| download | Ishtar-631267163d86ef506a6e23707024713265756d04.tar.bz2 Ishtar-631267163d86ef506a6e23707024713265756d04.zip  | |
Merge branch 'master' of lysithea.proxience.net:/home/proxience/git/ishtar
Diffstat (limited to 'archaeological_operations/import_from_csv.py')
| -rw-r--r-- | archaeological_operations/import_from_csv.py | 10 | 
1 files changed, 9 insertions, 1 deletions
diff --git a/archaeological_operations/import_from_csv.py b/archaeological_operations/import_from_csv.py index 41f322dc4..790f0e078 100644 --- a/archaeological_operations/import_from_csv.py +++ b/archaeological_operations/import_from_csv.py @@ -116,10 +116,18 @@ def parse_period(value):                  break      return period +_REPLACED_PERIOD = [('deuxieme', 'second')] +_REPLACED_PERIOD += [(y, x) for x, y in _REPLACED_PERIOD] +REPLACED_PERIOD_DCT = dict(_REPLACED_PERIOD) +  period_names = {}  for k in settings.ISHTAR_PERIODS.keys():      period = Period.objects.get(txt_idx=settings.ISHTAR_PERIODS[k]) -    period_names[slugify(period.label)] = period +    slug = slugify(period.label) +    period_names[slug] = period +    for k in REPLACED_PERIOD_DCT.keys(): +        if k in slug: +            period_names[slug.replace(k, REPLACED_PERIOD_DCT[k])] = period  period_names_keys = period_names.keys()  period_names_keys.sort(key=len)  period_names_keys.reverse()  | 
