22 lines
600 B
Python
22 lines
600 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 file'))
|
|
|
|
class Meta:
|
|
"""Meta class."""
|
|
verbose_name = _('Image')
|
|
verbose_name_plural = _('Images')
|
|
|
|
def __str__(self):
|
|
"""String representation"""
|
|
return str(self.id)
|