Changes between Initial Version and Version 6 of Ticket #23572


Ignore:
Timestamp:
07/31/2015 03:01:21 PM (5 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23572

    • Property Owner nobody deleted
    • Property Triage Stage changed from Unreviewed to Accepted
  • Ticket #23572 – Description

    initial v6  
    11For my current project I need generate a complex queryset filter and I decide implement as custom lookup.
    22
    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 expresion:
     3I got the [https://docs.djangoproject.com/en/1.7/howto/custom-lookups/, example] as base to create custom lookup, but during test, this expression:
    44
    5 data = Rsce.filter(duration{{{__}}}ne = None)
     5`data = Rsce.filter(duration__ne = None)`
    66
    7 throw an exception. Any other expresion run smoothly.
     7throws an exception. Any other expression runs smoothly.
    88
    99Looking into code exception are thrown in this piece of code:
    10 
    11 
     10{{{
    1211        if value is None:
    1312            if lookups[-1] not in ('exact', 'iexact'):
    1413                raise ValueError("Cannot use None as a query value")
    15 
     14}}}
    1615IMHO the check in lookups must be avoided on custom lookups, allowing them to manage None values by themselves.
    17 
Back to Top