#23998: datetime.time default value on migrations
----------------------------+---------------------
Reporter: tuxskar | Owner: tuxskar
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------+---------------------
When trying to use `datetime.time(10)` value for a
`django.db.models.fields.TimeField` model default value on the default
value questioner the system raises this exception:
{{{
The datetime module is available, so you can do e.g. datetime.date.today()
>>> datetime.time(10)
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
[....]
File "/Users/tuxskar/.virtualenvs/caluny/lib/python2.7/site-
packages/django/db/migrations/questioner.py", line 126, in
ask_not_null_addition
return eval(code, {}, {"datetime": datetime_safe})
File "<string>", line 1, in <module>
TypeError: 'module' object is not callable
}}}
I have made a patch and attach here. (Github Pull Request)
--
Ticket URL: <https://code.djangoproject.com/ticket/23998>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.70c1498aadef4f75a832e13093bff684%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.