查询数据库表的命名问题

时间:2018-12-12 00:24:56

标签: python django

保存表单时,将其标记为可以在字段中保留为空白的pago并显示为False后,如何将False更改为0或任何其他值

Models.py

class MovRotativo(models.Model):
    checkin = models.DateTimeField(default=timezone.now())
    checkout = models.DateTimeField(null=True, blank=True)
    email = models.EmailField(blank=False)
    placa = models.CharField(max_length=8, blank=False)
    modelo = models.CharField(max_length=15, blank=False)
    valor_hora = models.DecimalField(
        max_digits=5, decimal_places=2, null=False, blank=False)
    pago = models.CharField(max_length=15, choices=PAGO_CHOICES)
    chk = models.CharField(("Situação"), max_length=15,
                       choices=SAIDA_CHOICES, default='Não')

0 个答案:

没有答案