Changes between Initial Version and Version 6 of Ticket #23572
- Timestamp:
- Jul 31, 2015, 3:01:21 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23572
- Property Triage Stage Unreviewed → Accepted
- Property Owner removed
-
Ticket #23572 – Description
initial v6 1 1 For my current project I need generate a complex queryset filter and I decide implement as custom lookup. 2 2 3 I got the [https://docs.djangoproject.com/en/1.7/howto/custom-lookups/, example] as base to create custom lookup, but during test, this expres ion:3 I got the [https://docs.djangoproject.com/en/1.7/howto/custom-lookups/, example] as base to create custom lookup, but during test, this expression: 4 4 5 data = Rsce.filter(duration{{{__}}}ne = None) 5 `data = Rsce.filter(duration__ne = None)` 6 6 7 throw an exception. Any other expresion runsmoothly.7 throws an exception. Any other expression runs smoothly. 8 8 9 9 Looking into code exception are thrown in this piece of code: 10 11 10 {{{ 12 11 if value is None: 13 12 if lookups[-1] not in ('exact', 'iexact'): 14 13 raise ValueError("Cannot use None as a query value") 15 14 }}} 16 15 IMHO the check in lookups must be avoided on custom lookups, allowing them to manage None values by themselves. 17