gault-millau/apps/gallery/models.py

22 lines
613 B
Python

from django.utils.translation import gettext_lazy as _
from easy_thumbnails.fields import ThumbnailerImageField
from utils.methods import image_path
from utils.models import ProjectBaseMixin, ImageMixin
class Image(ProjectBaseMixin, ImageMixin):
"""Image model."""
image = ThumbnailerImageField(upload_to=image_path,
verbose_name=_('Image'))
class Meta:
"""Meta class."""
verbose_name = _('Image')
verbose_name_plural = _('Images')
def __str__(self):
"""String representation of image instance"""
return str(self.id)