#29656: Range Fields do not support blank values via ModelForm ----------------------------------+-------------------------------------- Reporter: James Addison | Owner: nobody Type: Bug | Status: closed Component: contrib.postgres | Version: master Severity: Normal | Resolution: duplicate Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ----------------------------------+--------------------------------------
Comment (by Carlton Gibson): Hey James. It’s late for me now so I can’t address each point you make individually. I will though make time to go over this again just to be sure. Right now I’ll just say that I think this issue is a symptom of the more general problem that HTML forms don’t distinguish properly between empty string submissions when you mean empty string and empty string submissions when you mean None. (Or with checkboxes, not submitted vs false.) As such Django forms have to do their best to behave sensibly in the widest number of cases. (It’s been many years getting to where it is now: not that it can’t be improved but it’s pretty battle tested.) In your case you have a form with a different requirement, but I think you’ll need to add that logic yourself. As I said, I will though, have another think about this one. -- Ticket URL: <https://code.djangoproject.com/ticket/29656#comment:15> 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 post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.d732e96ace51fc924fe88a6130b64cba%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.