Skip to content

Commit

Permalink
Remove unused modified field on Upload model
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandenburgh committed Oct 16, 2023
1 parent 41f0343 commit 485df0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dandiapi/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
6 changes: 4 additions & 2 deletions dandiapi/api/models/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down

0 comments on commit 485df0f

Please sign in to comment.