2013-09-11 12:20:55 +00:00
|
|
|
from django.db import models
|
2020-09-26 21:21:43 +00:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2013-09-11 12:20:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class CaptionedFile(models.Model):
|
|
|
|
|
caption = models.CharField(max_length=200, verbose_name=_('caption'))
|
2016-05-20 08:30:07 +00:00
|
|
|
publication = models.FileField(upload_to='captioned-files', verbose_name=_('Uploaded File'))
|
2013-09-11 12:20:55 +00:00
|
|
|
|
2014-11-26 15:42:17 +00:00
|
|
|
def __str__(self):
|
2013-09-11 12:20:55 +00:00
|
|
|
return self.caption
|
|
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
verbose_name = _('Captioned File')
|
|
|
|
|
verbose_name_plural = _('Captioned Files')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UncaptionedFile(models.Model):
|
2016-05-20 08:30:07 +00:00
|
|
|
publication = models.FileField(upload_to='uncaptioned-files', verbose_name=_('Uploaded File'))
|
2013-09-11 12:20:55 +00:00
|
|
|
|
2014-11-26 15:42:17 +00:00
|
|
|
def __str__(self):
|
2016-05-07 23:29:17 +00:00
|
|
|
return self.publication.name
|
2013-09-11 12:20:55 +00:00
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
|
verbose_name = _('Uncaptioned File')
|
|
|
|
|
verbose_name_plural = _('Uncaptioned Files')
|