0

Current field in my model is as follows...

from django.utils import timezone

class Test(models.Model):
    assigned_date_time = models.DateTimeField(
        null=True, verbose_name='Assigned Date', default=timezone.now)

When this object is created, the assigned_date_time is always 0 or rather "midnight" of today. I'm not quite sure what I am doing wrong.

Thank you in advance.

Oh Great One
  • 374
  • 2
  • 17

1 Answers1

0

In order for the field default to be executed, a value should not be assigned to that field.

Oh Great One
  • 374
  • 2
  • 17