#20102 closed Uncategorized (needsinfo)
None no longer matches zero-length string on CharField
| Reported by: | Simon Litchfield | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 1.5 |
| Severity: | Normal | Keywords: | |
| Cc: | andrewsg | Triage Stage: | Unreviewed |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
I've just updated from 1.5 stable to latest commit aaec4f2bd8a63b3dceebad7804c5897e7874833d.
Model.objects.filter(mycharfield=None) used to return instances where mycharfield is actually a zero-length string.
Now, it seems I need to explicitly specify Model.objects.filter(mycharfield=).
Minor change, but the implications could be pretty severe for some apps.
Suggest either reverting to previous behaviour or updating the "backwards incompatible changes" list.
Change History (3)
comment:2 by , 13 years ago
| Cc: | added |
|---|
comment:3 by , 13 years ago
| Resolution: | → needsinfo |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I looked into this just now, and I was able to verify that filter(mycharfield=None) does not pick up empty strings in 1.6, but when I tested it in 1.5 stable the behavior was the same. Can you offer reproduction steps for the behavior you describe on 1.5?