datetime.time default value on migrations
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)
Change History
(6)
Has patch: |
unset
|
Resolution: |
→ needsinfo
|
Status: |
new → closed
|
Resolution: |
needsinfo
|
Status: |
closed → new
|
Has patch: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Can you provide the steps to reproduce the bug, more clearly? I don't get any error when I enter the following in the shell of django 1.7:
Is that what you meant?
Also, you have mentioned that a patch has been attached but I couldn't find any attachments.