From a3e22fb0ce0804f00f3e2254f755a4a0cbf2c632 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 18 Jul 2017 13:16:57 +0200 Subject: Context record sheet: add documentation field --- archaeological_context_records/templates/ishtar/sheet_contextrecord.html | 1 + 1 file changed, 1 insertion(+) diff --git a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html index 29e45d3a9..b10f46325 100644 --- a/archaeological_context_records/templates/ishtar/sheet_contextrecord.html +++ b/archaeological_context_records/templates/ishtar/sheet_contextrecord.html @@ -23,6 +23,7 @@ {% field_li "Excavation technic" item.excavation_technic %} {% field_li_multiple "Chronology" item.datings %} {% field_li "Town" item.parcel.town %} + {% field_li_multiple "Documentation" item.documentations %} {% field "Comment on datings" item.datings_comment "
" "
" %} -- cgit v1.2.3 From 7b883bcc1e4b34024ac624cb8162864d7b89482f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 20 Jul 2017 17:07:27 +0200 Subject: Imports: fix skip of the first line when import file is not utf-8 --- ishtar_common/models.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 5c84447a4..e49044cfd 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2464,20 +2464,21 @@ class Import(models.Model): tmpdir = tempfile.mkdtemp(prefix='tmp-ishtar-') imported_file = z.extract(filename, tmpdir) - with open(imported_file) as csv_file: - encodings = [self.encoding] - encodings += [coding for coding, c in ENCODINGS] - for encoding in encodings: - try: + encodings = [self.encoding] + encodings += [coding for coding, c in ENCODINGS + if coding != self.encoding] + for encoding in encodings: + try: + with open(imported_file) as csv_file: vals = [line for line in unicodecsv.reader(csv_file, encoding=encoding)] if tmpdir: shutil.rmtree(tmpdir) + print(encoding, imported_file, vals[0]) return vals - except UnicodeDecodeError: - if encoding != encodings[-1]: - csv_file.seek(0) + except UnicodeDecodeError: + print(encoding, encodings) if tmpdir: shutil.rmtree(tmpdir) return [] -- cgit v1.2.3 From a436f6a03380ddbf5d3c692798d0be294528c8d6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 20 Jul 2017 17:28:31 +0200 Subject: v0.99.25 --- CHANGES.md | 9 +++++++++ version.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 7619cc407..198be8ce3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,15 @@ Ishtar changelog ================ +v0.99.25 (2017-07-20) +--------------------- +### Features ### +- Context record sheet: add documentation field + +### Bug fixes ### +- Imports: fix skip of lines when import file is not utf-8 +- Fix display view + v0.99.24 (2017-07-12) --------------------- ### Features ### diff --git a/version.py b/version.py index 96dee143e..e06be2011 100644 --- a/version.py +++ b/version.py @@ -1,4 +1,4 @@ -VERSION = (0, 99, 24) +VERSION = (0, 99, 25) def get_version(): -- cgit v1.2.3 From 8fa0f928e68e10d4ef055bf9afd47e0e91ce7b55 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 20 Jul 2017 17:38:29 +0200 Subject: Remove debug --- ishtar_common/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ishtar_common/models.py b/ishtar_common/models.py index e49044cfd..7f79df72f 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2475,10 +2475,9 @@ class Import(models.Model): encoding=encoding)] if tmpdir: shutil.rmtree(tmpdir) - print(encoding, imported_file, vals[0]) return vals except UnicodeDecodeError: - print(encoding, encodings) + pass # try the next encoding if tmpdir: shutil.rmtree(tmpdir) return [] -- cgit v1.2.3