from django.db import models

# Create your models here.
from django.utils.translation import gettext_lazy as _


class LabelsBatch(models.Model):
    company=models.ForeignKey('company.Company',verbose_name=_('所属企业'), on_delete=models.CASCADE)
    user=models.ForeignKey('company.User',verbose_name=_('用户'), on_delete=models.CASCADE)
    title=models.CharField(_('标题'),max_length=100,blank=True,null=True)    
    remark=models.CharField(_('备注说明'),max_length=100,blank=True,null=True)
    dt=models.DateField(_('日期'),auto_now_add=True)
    tm=models.DateTimeField(_('时间'),auto_now_add=True)    

    class Meta:
        verbose_name = _('标签采集批次')
        verbose_name_plural = _('标签采集批次')

    def __str__(self):
        return self.title


class LabelsDetail(models.Model):
    batch=models.ForeignKey(LabelsBatch, verbose_name=_('批次'), on_delete=models.CASCADE)
    label=models.CharField(_('标签号码'),max_length=20)
    remark=models.CharField(_('备注说明'),max_length=50,blank=True,null=True)
    tm=models.DateTimeField(_('时间'),auto_now_add=True)

    class Meta:
        verbose_name = _('标签采集明细')
        verbose_name_plural = _('标签采集明细')



