#31324: Filter JSONField using `=None` -------------------------------------+------------------------------------- Reporter: Nikolay Tretyak | Owner: Nikolay | Tretyak Type: Bug | Status: assigned Component: Database layer | Version: 3.0 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Nikolay Tretyak): Yes, {{{Charfield}}} uses {{{''}}} as an empty value. But if you use {{{filter(charfield=None)}}} it will produce {{{IS NULL}}} sql, not {{{= ''}}}. And this behavior is clear. So, why should we transform {{{filter(jsonfield=None)}}} to {{{= 'null'}}}? I think that the majority of JSONField users want to check if the {{{jsonfield__key}}} is {{{'null'}}}. But are there any use cases when they want to store just {{{'null'}}} in the whole field instead of SQL {{{NULL}}}? -- Ticket URL: <https://code.djangoproject.com/ticket/31324#comment:11> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.333451de2abff299edf3156589dcd66e%40djangoproject.com.