ojuso-map/apps/files/models.py
2018-04-30 22:23:36 -04:00

24 lines
417 B
Python

from django.contrib.auth.models import User
from django.db import models
from apps.map.models import CaseStudy, CaseStudyDraft
class BaseFile(models.Model):
file = models.FileField(
upload_to='.',
)
user = models.ForeignKey(
User, related_name='files'
)
class Meta:
abstract = True
def __str__(self):
return self.file.name
class File(BaseFile):
pass