from django.db import models
from django.contrib.auth.models import User
from tinymce import models as tinymce_models
from model_utils import Choices


# Create your models here.

class bitpendientes(models.Model):
    STATUS = Choices('Bitacora', 'Pendiente', 'Realizado')
    STATUS1 = Choices('SI', 'NO')
    n_reporte  = models.CharField(max_length=50, null=False, verbose_name='NUM. DE REPORTE')
    fecha = models.DateField(verbose_name='FECHA')
    reporta_ib = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, verbose_name='REPORTA IB')
    n_control = models.IntegerField(null=False, blank=False, verbose_name='NO. DE CONTROL DEL EQUIPO')
    falla = models.CharField(max_length=250, null=True, blank=True, verbose_name='FALLA PRESENTADA')
    contrato = models.CharField(choices=STATUS1, default=STATUS1.SI, max_length=5, verbose_name='CON CONTRATO')
    reprovedor = models.CharField(max_length=250, null=True, blank=True,  verbose_name='NO. DE REPORTE PROVEDOR')
    refacciones = tinymce_models.HTMLField(null=True, blank=True, verbose_name='REFACCIONES PARA EQUIPOS SIN CONTRATO')
    concluido = models.CharField(choices=STATUS, default=STATUS.Pendiente, max_length=20, verbose_name='Pendiente')
        
    def __str__(self):
        return self.n_reporte
    
    class Meta:
        verbose_name = 'Bitacora Pendientes'
        verbose_name_plural = 'Bitacora Pendientes'
        ordering = ['-id']



