Compare commits

...

2 commits

Author SHA1 Message Date
7e6dd9d82d
Update: docker image & Fix: line endings 2024-03-16 22:32:45 +01:00
bcb3dedc36
Add: MIME type & file extension fields 2024-03-14 22:41:30 +01:00
2 changed files with 23 additions and 15 deletions

View file

@ -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:

View file

@ -1,16 +1,16 @@
version: "3.8" version: "3.8"
services: services:
django: django:
build: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
- USER_ID=1000 - USER_ID=1000
image: gallery-archivist:dev image: git.aroy-art.com/aroy/gallery-archivist:dev
#container_name: django #container_name: django
command: > command: >
sh -c "cd archivist sh -c "cd archivist
&& python manage.py runserver 0.0.0.0:8000" && python manage.py runserver 0.0.0.0:8000"
volumes: volumes:
- .:/app/ - .:/app/
@ -27,10 +27,10 @@ services:
celery-worker: celery-worker:
#build: . #build: .
image: gallery-archivist:dev image: git.aroy-art.com/aroy/gallery-archivist:dev
#container_name: celery_worker #container_name: celery_worker
command: > command: >
sh -c "cd archivist sh -c "cd archivist
&& celery -A core worker -l INFO" && celery -A core worker -l INFO"
volumes: volumes:
- .:/app/ - .:/app/
@ -44,9 +44,9 @@ services:
celery-beat: celery-beat:
#build: . #build: .
image: gallery-archivist:dev image: git.aroy-art.com/aroy/gallery-archivist:dev
command: > command: >
sh -c "cd archivist sh -c "cd archivist
&& celery -A core beat -l INFO" && celery -A core beat -l INFO"
volumes: volumes:
- .:/app/ - .:/app/