diff --git a/todo/operations/csv_importer.py b/todo/operations/csv_importer.py index a7e78a9..62e777e 100644 --- a/todo/operations/csv_importer.py +++ b/todo/operations/csv_importer.py @@ -68,6 +68,7 @@ class CSVImporter: self.summary_msgs.append(f"\nProcessed {self.line_count} CSV rows") self.summary_msgs.append(f"Upserted {self.upsert_count} rows") + self.summary_msgs.append(f"Skipped {self.line_count - self.upsert_count} rows") _res = { "errors": self.error_msgs, diff --git a/todo/templates/todo/import_csv.html b/todo/templates/todo/import_csv.html new file mode 100644 index 0000000..ec91b45 --- /dev/null +++ b/todo/templates/todo/import_csv.html @@ -0,0 +1,80 @@ +{% extends "todo/base.html" %} +{% load static %} + +{% block title %}Import CSV{% endblock %} + +{% block content %} +
+ Batch-import tasks by uploading a specifically-formatted CSV. + See documentation for formatting rules. + Successs and failures will be reported here. +
+ + {% if results %} ++ Summary: +
++ Upserts (tasks created or updated): +
++ Errors (tasks NOT created or updated): +
+