Cannot add TextField with unhashable default with MySQL
Adding a TextField that has an unhashable default fails with MySQL, for example with {}
as the default:
Traceback (most recent call last):
[...]
File "[...]/django/db/backends/mysql/schema.py", line 53, in add_field
if self.skip_default(field) and field.default not in {None, NOT_PROVIDED}:
TypeError: unhashable type: 'dict'
One use case for fields like this is JSONField at https://github.com/bradjasper/django-jsonfield
Change History
(14)
Triage Stage: |
Unreviewed → Accepted
|
Needs documentation: |
unset
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Triage Stage: |
Ready for checkin → Accepted
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
https://github.com/django/django/pull/5281