#25393: Cannot add TextField with unhashable default with MySQL
----------------------------------------------+--------------------
Reporter: scop | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
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
--
Ticket URL: <https://code.djangoproject.com/ticket/25393>
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/047.e1dc1684e960ccd0e9fec6bdbda821f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.