storage yaratildi
This commit is contained in:
1
core/apps/storage/models/__init__.py
Normal file
1
core/apps/storage/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .fileupload import * # noqa
|
||||
23
core/apps/storage/models/fileupload.py
Normal file
23
core/apps/storage/models/fileupload.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_core.models import AbstractBaseModel
|
||||
from model_bakery import baker
|
||||
|
||||
|
||||
import uuid
|
||||
|
||||
class FileuploadModel(AbstractBaseModel):
|
||||
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
||||
file = models.FileField(verbose_name=_("file"), upload_to="uploads/")
|
||||
original_name = models.CharField(verbose_name=_("original name"), max_length=255)
|
||||
bucket = models.CharField(verbose_name=_("bucket"), max_length=100, default="uploads")
|
||||
content_type = models.CharField(verbose_name=_("content type"), max_length=100, null=True, blank=True)
|
||||
file_size = models.BigIntegerField(verbose_name=_("file size"), null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.original_name
|
||||
|
||||
class Meta:
|
||||
db_table = "file_uploads"
|
||||
verbose_name = _("File Upload")
|
||||
verbose_name_plural = _("File Uploads")
|
||||
Reference in New Issue
Block a user