Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2021-04-30 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:  (none)
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 Fixed in c979c0a2b8abca325a549961fd7a17bdc36bcb1f. You can set
 `can_use_none_as_rhs = True` to skip this check.

-- 
Ticket URL: 
Django 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.96d963a3a5d3961181af0e908bf581cc%40djangoproject.com.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2021-02-06 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mariusz Felisiak):

 * owner:  Sergey Fedoseev => (none)
 * status:  assigned => new


-- 
Ticket URL: 
Django 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.cdada4ae07fd8685a984f0c9d17429e2%40djangoproject.com.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2017-07-30 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:  Sergey
 |  Fedoseev
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Sergey Fedoseev):

 * owner:  (none) => Sergey Fedoseev
 * status:  new => assigned


-- 
Ticket URL: 
Django 
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/069.b2e3ab23f5a11139a4fb40d1fb9c7493%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2015-07-31 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by timgraham:

Old description:

> For my current project I need generate a complex queryset filter and I
> decide implement as custom lookup.
>
> 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:
>
> data = Rsce.filter(duration{{{__}}}ne = None)
>
> throw an exception. Any other expresion run smoothly.
>
> Looking into code exception are thrown in this piece of code:
>

> if value is None:
> if lookups[-1] not in ('exact', 'iexact'):
> raise ValueError("Cannot use None as a query value")
>
> IMHO the check in lookups must be avoided on custom lookups, allowing
> them to manage None values by themselves.

New description:

 For my current project I need generate a complex queryset filter and I
 decide implement as custom lookup.

 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:

 `data = Rsce.filter(duration__ne = None)`

 throws an exception. Any other expression runs smoothly.

 Looking into code exception are thrown in this piece of code:
 {{{
 if value is None:
 if lookups[-1] not in ('exact', 'iexact'):
 raise ValueError("Cannot use None as a query value")
 }}}
 IMHO the check in lookups must be avoided on custom lookups, allowing them
 to manage None values by themselves.

--

--
Ticket URL: 
Django 
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/069.b1cb6a013d206810d47c8d63be205ffb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2014-11-15 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  custom lookup, db|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by nielsvanoch):

 * owner:  nielsvanoch =>
 * status:  assigned => new


Comment:

 I had a look at this, but couldn't find a good place/pattern to put it in.
 The problem is that the behavior of the two lookups that currently act
 different (exact and iexact) is tricky to implement, because you need to
 have already constructed your Lookup object, but then replace it by a
 different one. If anyone has a good idea about a structure to solve this,
 I'd be happy to take another crack (although realistically, that person
 could probably also complete the patch easily).

--
Ticket URL: 
Django 
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/069.d180a15847d1ed981a85fb966b9b4e7c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2014-11-15 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:
 Type:  Bug  |  nielsvanoch
Component:  Database layer   |   Status:  assigned
  (models, ORM)  |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by nielsvanoch):

 * status:  new => assigned
 * owner:   => nielsvanoch


--
Ticket URL: 
Django 
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/069.045eca9deed7c809ec7ab8f771fc0344%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2014-10-13 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  custom lookup, db|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by brianmcdonnell):

 * status:  assigned => new
 * owner:  brianmcdonnell =>


--
Ticket URL: 
Django 
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/069.c13571712b6d35fec702e60ad60da276%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2014-10-13 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:
 Type:  Bug  |  brianmcdonnell
Component:  Database layer   |   Status:  assigned
  (models, ORM)  |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:  custom lookup, db| Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by brianmcdonnell):

 * owner:  nobody => brianmcdonnell
 * status:  new => assigned


--
Ticket URL: 
Django 
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/069.ce0b2f0f71f1ea1d0c999a43640d2d85%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23572: Exception on Custom Lookups when right value is None.

2014-09-30 Thread Django
#23572: Exception on Custom Lookups when right value is None.
-+-
 Reporter:  maherma-adg  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.7
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  custom lookup, db|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by akaariai):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 Yes, it seems this check belongs to the Lookup (with a base implementation
 that raises the ValueError).

 BTW you are likely going to stumble upon some other limitations in the
 current Lookup implementation. A `.exclude(duration__ne=None)` call might
 not work as expected (that is, return complement of
 `.filter(duration__ne=None)`).

--
Ticket URL: 
Django 
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/069.d10e8d5c25efcdafc2c04df7aa0a408a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.