mirror of
https://github.com/FunnyWolf/agentic-soc-platform.git
synced 2026-08-22 13:12:56 +02:00
24 lines
700 B
Python
24 lines
700 B
Python
import uuid
|
|
|
|
from django.conf import settings
|
|
from django.db import models
|
|
|
|
|
|
class Attachment(models.Model):
|
|
access_key = models.UUIDField(default=uuid.uuid4, unique=True, editable=False)
|
|
file = models.FileField(upload_to="attachments/%Y/%m/")
|
|
filename = models.CharField(max_length=255)
|
|
size = models.PositiveIntegerField()
|
|
uploaded_by = models.ForeignKey(
|
|
settings.AUTH_USER_MODEL, null=True, blank=True,
|
|
on_delete=models.SET_NULL, related_name="attachments"
|
|
)
|
|
uploaded_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
class Meta:
|
|
db_table = "attachments"
|
|
ordering = ["-uploaded_at"]
|
|
|
|
def __str__(self):
|
|
return self.filename
|