Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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:1 by andrewsg, 12 years ago

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?

Version 0, edited 12 years ago by andrewsg (next)

comment:2 by andrewsg, 12 years ago

Cc: andrewsg added

comment:3 by andrewsg, 12 years ago

Resolution: needsinfo
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top