From 227fa44e7ee4bb8c12850914dd8a70fcfa37c3a3 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 24 Oct 2023 22:56:43 +0100 Subject: [PATCH] add date to uploads --- .../0024_uncategoriseddicom_created_date.py | 19 +++++++++++++++++++ atlas/models.py | 2 ++ atlas/templates/atlas/user_uploads.html | 4 ++-- atlas/views.py | 5 +++-- 4 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 atlas/migrations/0024_uncategoriseddicom_created_date.py diff --git a/atlas/migrations/0024_uncategoriseddicom_created_date.py b/atlas/migrations/0024_uncategoriseddicom_created_date.py new file mode 100644 index 00000000..30452ed1 --- /dev/null +++ b/atlas/migrations/0024_uncategoriseddicom_created_date.py @@ -0,0 +1,19 @@ +# Generated by Django 4.1.4 on 2023-10-24 21:31 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('atlas', '0023_condition_rcr_curriculum_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='uncategoriseddicom', + name='created_date', + field=models.DateTimeField(default=django.utils.timezone.now), + ), + ] diff --git a/atlas/models.py b/atlas/models.py index e9d20e1c..1232eb8a 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -822,6 +822,8 @@ class UncategorisedDicom(models.Model): image_md5_hash = models.CharField(max_length=32, null=True, blank=True) + created_date = models.DateTimeField(default=timezone.now) + def check_for_duplicates(self, image_hash): duplicate = None diff --git a/atlas/templates/atlas/user_uploads.html b/atlas/templates/atlas/user_uploads.html index 7b283177..63efec2b 100644 --- a/atlas/templates/atlas/user_uploads.html +++ b/atlas/templates/atlas/user_uploads.html @@ -13,12 +13,12 @@ {% if series_list %}