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


# Create your models here.
class Config(models.Model):
    title = models.CharField(_('Title'), max_length=200)
    type = models.CharField(_('Type'), max_length=200)
    value = models.TextField(_('Value'), max_length=20000)
    created_at = models.DateTimeField(_('created_at'), auto_now_add=True)

    def __str__(self):
        return self.title

    class Meta:
        db_table = 'configs'
        verbose_name_plural = 'Config'


# Create your models here.
class MailList(models.Model):
    email = models.CharField(_('Email'), max_length=200)
    unsubscribe = models.BooleanField(_('Is Unsubscribe'), default=False)
    created_at = models.DateTimeField(_('Created At'), auto_now_add=True)

    def __str__(self):
        return self.email

    class Meta:
        db_table = 'mail_lists'
        verbose_name_plural = 'Mail List'
