Update on Timefield Django 2.0

Asked

Viewed 110 times

1

I have a model with several fields, one of them is the Timefield type:

class Venda(models.Model):
    id = models.AutoField(u'AÇAIEX', primary_key=True)
    hora_saida = models.TimeField(max_length=6)

To save on the system the field works beauty, now when will update the field returns only the minutes and seconds not bringing the hours, the database I use is mysql:

Example in the Bank:

inserir a descrição da imagem aqui

Example in the System that brings only minutes and seconds inserir a descrição da imagem aqui

1 answer

0


Solved added code in Setting:

TIME_INPUT_FORMATS = [ '%H:%M', ]

So he returns hours and minutes.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.