From 614f7102bab4e07a5944cd7999303c3b36318059 Mon Sep 17 00:00:00 2001 From: Rupika Date: Wed, 13 Feb 2019 21:17:31 -0800 Subject: [PATCH] altered data_date to accommodate null date values --- back/backend/models.py | 2 +- back/backend/views.py | 4 ++-- back/db.sqlite3 | Bin 105472 -> 106496 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/back/backend/models.py b/back/backend/models.py index 557020f..0348d0c 100644 --- a/back/backend/models.py +++ b/back/backend/models.py @@ -34,7 +34,7 @@ class Field(models.Model): completed = models.BooleanField(default=False) data_bool = models.BooleanField(default=False) data_decimal = models.DecimalField(max_digits=9, decimal_places=2, null=True, blank=True) - data_date = models.DateField(default=datetime.date.today) + data_date = models.DateField(null=True, blank=True) data_file = models.FileField(upload_to='uploads/%Y/%m/%d/', max_length=512, null=True, blank=True) data_string = models.TextField(default='', blank=True) data_integer = models.IntegerField(default=0, blank=True) diff --git a/back/backend/views.py b/back/backend/views.py index 3e256ed..ec863ff 100644 --- a/back/backend/views.py +++ b/back/backend/views.py @@ -185,8 +185,8 @@ def section(request, report_pk, section_pk): request.data[key] == "" or request.data[key] is None ): - update_field.data_date = datetime.date.today() - # update_field.data_date = None + # update_field.data_date = datetime.date.today() + update_field.data_date = None else: update_field.data_date = request.data[key] diff --git a/back/db.sqlite3 b/back/db.sqlite3 index df59c2b7ffeddee4709975fee7c6e2c65907d874..7dace4032a417b0a1763b4a3f159693785d3aa2b 100644 GIT binary patch delta 4338 zcmeHK?N3uz7(eG8XbY5zI3x;43u-C0<=)%U(kjaqssk-BsZ7L|dTFmxDXo^`Vxra? zaW5`0vTJhVKDlLCG+8pU#!37#&HS_vZgJVNeK6Uw%q820nJn?cX0n~r-oD)S7W@Nj za!$C1^E}Tvzw`W_mvc*+b9XhDTUI{=08HZ%!b5|{;-b}|e+X=k>#FhBDs*dcrUQM4 zZij`+DQe%Wcng`Ru^I74WYtsXDc%S6qJPoTbVJo+WW`?_H{hw$P*2?ldg{8C zdVqdMXV56((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