[Python] Accidentally set a wrong default value in Django model

Discussão em 'Python' iniciado por Stack, Março 11, 2025.

  1. Stack

    Stack Membro Participativo

    So, I added a new TimeField to my Django model. When I did python3 manage.py make migrations, it asked me to choose two options: set a default value now or add one another way. I chose to set one now.

    I wasn't thinking and set it to "" which is an incorrect format for a time field. I have tried everything, even manually in sqlite, removing the new field and more, but I still get an error when running python3 manage.py migrate which is saying this:

    django.core.exceptions.ValidationError: ['“” value has an invalid format. It must be in HH:MM[:ss[.uuuuuu]] format.']


    If someone can help. me, it will be gladly appreciated!

    Continue reading...

Compartilhe esta Página