diff --git a/dandiapi/api/admin.py b/dandiapi/api/admin.py index fcad88ce4..700ff6152 100644 --- a/dandiapi/api/admin.py +++ b/dandiapi/api/admin.py @@ -232,5 +232,5 @@ class AssetAdmin(admin.ModelAdmin): @admin.register(Upload) class UploadAdmin(admin.ModelAdmin): - list_display = ['id', 'upload_id', 'blob', 'etag', 'upload_id', 'size', 'modified', 'created'] + list_display = ['id', 'upload_id', 'blob', 'etag', 'upload_id', 'size', 'created'] list_display_links = ['id', 'upload_id'] diff --git a/dandiapi/api/models/upload.py b/dandiapi/api/models/upload.py index 723aa7a7f..5479e593e 100644 --- a/dandiapi/api/models/upload.py +++ b/dandiapi/api/models/upload.py @@ -6,7 +6,7 @@ from django.conf import settings from django.core.validators import RegexValidator from django.db import models -from django_extensions.db.models import TimeStampedModel +from django_extensions.db.models import CreationDateTimeField from dandiapi.api.storage import ( get_embargo_storage, @@ -19,13 +19,15 @@ from .dandiset import Dandiset -class BaseUpload(TimeStampedModel): +class BaseUpload(models.Model): ETAG_REGEX = r'[0-9a-f]{32}(-[1-9][0-9]*)?' class Meta: indexes = [models.Index(fields=['etag'])] abstract = True + created = CreationDateTimeField() + # This is the key used to generate the object key, and the primary identifier for the upload. upload_id = models.UUIDField(unique=True, default=uuid4, db_index=True) etag = models.CharField(