From 19c9deb5d3367c761e65260f25009c1982a1b7df Mon Sep 17 00:00:00 2001 From: Scot Hacker Date: Sun, 10 Mar 2019 15:18:16 -0700 Subject: [PATCH] Fix default values and finish example spreadsheet --- todo/data/import_example.csv | 8 +++----- todo/operations/csv_importer.py | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/todo/data/import_example.csv b/todo/data/import_example.csv index 998e778..b1d6c6d 100644 --- a/todo/data/import_example.csv +++ b/todo/data/import_example.csv @@ -1,6 +1,4 @@ Title,Group,Task List,Created Date,Due Date,Completed,Created By,Assigned To,Note,Priority -Make dinner,Scuba Divers,Groovy,2012-03-12,2012-03-14,No,shacker,shacker,Temmo is a dog,3 -Bake bread,Scuba Divers,Example List,2012-03-14,2012-03-14,,nonexistentusername,,, -Eat food,Scuba Divers,Groovy,,2015-06-24,Yes,user1,user1,Every generation throws a hero up the pop charts,77 -Be glad,Scuba Divers,Example List,2019-03-07,,,user3,user2,,1 -Dog food,Scuba Divers,Example List,2019-03-07,,,,user2,,1 \ No newline at end of file +Make dinner,Scuba Divers,Web project,,,No,shacker,,Please check with mgmt first,3 +Bake bread,Scuba Divers,Example List,2012-03-14,2012-03-14,,mr_random,,, +Bring dessert,Scuba Divers,Web project,,2015-06-24,Yes,elly,user1,Every generation throws a hero up the pop charts,77 \ No newline at end of file diff --git a/todo/operations/csv_importer.py b/todo/operations/csv_importer.py index 02e8357..0d28152 100644 --- a/todo/operations/csv_importer.py +++ b/todo/operations/csv_importer.py @@ -60,10 +60,10 @@ class CSVImporter: task_list=newrow.get("Task List"), title=newrow.get("Title"), defaults={ - "assigned_to": newrow.get("Assigned To"), + "assigned_to": newrow.get("Assigned To") if newrow.get("Assigned To") else None, "completed": newrow.get("Completed"), - "created_date": newrow.get("Created Date"), - "due_date": newrow.get("Due Date"), + "created_date": newrow.get("Created Date") if newrow.get("Created Date") else None, + "due_date": newrow.get("Due Date") if newrow.get("Due Date") else None, "note": newrow.get("Note"), "priority": newrow.get("Priority"), },