mirror of
https://github.com/leaders-of-digital-9-task/backend.git
synced 2024-12-01 13:33:48 +03:00
17 lines
452 B
Python
17 lines
452 B
Python
|
from django.contrib.auth import get_user_model
|
||
|
from django.db import models
|
||
|
from utils.files import media_upload_path
|
||
|
|
||
|
User = get_user_model()
|
||
|
|
||
|
|
||
|
class Dicom(models.Model):
|
||
|
user = models.ForeignKey(User, related_name="files", on_delete=models.CASCADE)
|
||
|
slug = models.SlugField()
|
||
|
|
||
|
file = models.FileField(upload_to=media_upload_path)
|
||
|
uploaded = models.DateTimeField(auto_now_add=True)
|
||
|
|
||
|
def __str__(self):
|
||
|
return self.file.name
|