[Python] Difference between auto_now and auto_now_add

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    What I understood in Django models field's attributes is

    • auto_now - updates the value of field to current time and date every time the model.save() is called.
    • auto_now_add - updates the value with the time and date of creation of record.

    My question is what if a field in model contains both the auto_now and auto_now_add set to True? What happens in that case?

    Continue reading...

Compartilhe esta Página