#34435: JSONField with default='' raises warning "JSONField default should be a
callable"
-----------------------------------------+------------------------
               Reporter:  Tobias Krönke  |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Uncategorized  |        Version:  4.1
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Hi! I have a model with this field:


 {{{
 message = models.JSONField(editable=False, default='')
 }}}

 When running

 {{{
 manage.py check
 }}}

 I receive a warning, that IMO should not be triggered:

 {{{
 message: (fields.E010) JSONField default should be a callable instead of
 an instance so that it's not shared between all field instances.
         HINT: Use a callable instead, e.g., use `dict` instead of `{}`.
 }}}

 django should check, if the default is mutable and only if so issue that
 warning.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34435>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701871367e350-0f965a55-1a24-47cc-95fa-b4aa06db36ed-000000%40eu-central-1.amazonses.com.

Reply via email to