from django.utils.translation import ugettext_lazy as _
from django.db import models


class NewsTeaser(models.Model):
    image_url = models.URLField(_('Image URL'), blank=False, null=True)
    title = models.CharField(_('Title'), max_length=300, blank=False, null=False)
    description = models.TextField(_('Description'), blank=False, null=True)
    date = models.DateField(blank=False, null=True)
    order_id = models.IntegerField(blank=False, null=False, default=-1)
    news_article_url = models.URLField(_('News Article URL'), blank=False, null=True)
    image_source = models.CharField(_('Image Source'), max_length=100, blank=False, null=False)

    def __str__(self):
        return '{}'.format(self.title)
