model change with DateTime field
|Reported by:||niki75@…||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I created a Model class with several field. next I added a models.DateTimeField field.
Next I just
python manage.py makemigrations [OK]
next I tried with:
python manage.py migrate
but I received the following error:
field=models.DateTimeField(default=date(2014, 4, 18)),
NameError: name 'date' is not defined
I see in the migration file the import to datetime is present:
but in the line where is defined the date is missing datetime.date
field=models.DateTimeField(default=datetime.date(2014, 4, 18)),
I modified on this way and now it works.