Add: MIME type & file extension fields
This commit is contained in:
parent
6e8ff8a4e6
commit
bcb3dedc36
1 changed files with 12 additions and 4 deletions
|
@ -23,9 +23,11 @@ def get_upload_to_banner(instance, filename):
|
||||||
|
|
||||||
class User_Profile_Images(models.Model):
|
class User_Profile_Images(models.Model):
|
||||||
|
|
||||||
file_hash = models.CharField(unique=True, max_length=64,)
|
file_hash = models.CharField(unique=True, max_length=64)
|
||||||
file_name = models.CharField(max_length=150, blank=True)
|
file_name = models.CharField(max_length=150, blank=True)
|
||||||
file = models.FileField(upload_to=get_upload_to_profile, blank=True)
|
file = models.FileField(upload_to=get_upload_to_profile, blank=True)
|
||||||
|
file_mime = models.CharField(max_length=64, blank=True)
|
||||||
|
file_ext = models.CharField(max_length=64, blank=True)
|
||||||
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -41,9 +43,11 @@ class User_Profile_Images(models.Model):
|
||||||
|
|
||||||
class User_Banner_Images(models.Model):
|
class User_Banner_Images(models.Model):
|
||||||
|
|
||||||
file_hash = models.CharField(unique=True, max_length=64,)
|
file_hash = models.CharField(unique=True, max_length=64)
|
||||||
file_name = models.CharField(max_length=150, blank=True)
|
file_name = models.CharField(max_length=150, blank=True)
|
||||||
file = models.FileField(upload_to=get_upload_to_banner, blank=True)
|
file = models.FileField(upload_to=get_upload_to_banner, blank=True)
|
||||||
|
file_mime = models.CharField(max_length=64, blank=True)
|
||||||
|
file_ext = models.CharField(max_length=64, blank=True)
|
||||||
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -59,9 +63,11 @@ class User_Banner_Images(models.Model):
|
||||||
|
|
||||||
class Submission_File(models.Model):
|
class Submission_File(models.Model):
|
||||||
|
|
||||||
file_hash = models.CharField(unique=True, max_length=64,)
|
file_hash = models.CharField(unique=True, max_length=64)
|
||||||
file_name = models.CharField(max_length=150, blank=True)
|
file_name = models.CharField(max_length=150, blank=True)
|
||||||
file = models.FileField(upload_to=get_upload_to_submission, blank=True)
|
file = models.FileField(upload_to=get_upload_to_submission, blank=True)
|
||||||
|
file_mime = models.CharField(max_length=64, blank=True)
|
||||||
|
file_ext = models.CharField(max_length=64, blank=True)
|
||||||
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@ -77,9 +83,11 @@ class Submission_File(models.Model):
|
||||||
|
|
||||||
class Metadata_Files(models.Model):
|
class Metadata_Files(models.Model):
|
||||||
|
|
||||||
file_hash = models.CharField(unique=True, max_length=64,)
|
file_hash = models.CharField(unique=True, max_length=64)
|
||||||
file_name = models.CharField(max_length=150, blank=True)
|
file_name = models.CharField(max_length=150, blank=True)
|
||||||
file = models.FileField(upload_to=get_upload_to_metadata, blank=True)
|
file = models.FileField(upload_to=get_upload_to_metadata, blank=True)
|
||||||
|
file_mime = models.CharField(max_length=64, blank=True)
|
||||||
|
file_ext = models.CharField(max_length=64, blank=True)
|
||||||
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
date_added = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
Loading…
Reference in a new issue