[Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
---+
   Reporter:  Fraser Nevett|  Owner:  nobody
   Type:  Bug  | Status:  new
  Component:  Template system  |Version:  1.11
   Severity:  Normal   |   Keywords:
   Triage Stage:  Unreviewed   |  Has patch:  0
Needs documentation:  0|Needs tests:  0
Patch needs improvement:  0|  Easy pickings:  0
  UI/UX:  0|
---+
 Trying to render a template variable named **inf** does not work:

 {{{#!python
 >>> from django.template import Template, Context
 >>> Template('{{ inf }}').render(Context({'inf': 'xxx'}))
 Traceback (most recent call last):
   File "", line 1, in 
   File "/tmp/venv/lib/python2.7/site-packages/django/template/base.py",
 line 191, in __init__
 self.nodelist = self.compile_nodelist()
   File "/tmp/venv/lib/python2.7/site-packages/django/template/base.py",
 line 233, in compile_nodelist
 e.template_debug = self.get_exception_info(e, e.token)
 AttributeError: 'exceptions.OverflowError' object has no attribute 'token'
 }}}

 It also fails if the variable is undefined in the context:
 {{{#!python
 >>> Template('{{ inf }}').render(Context())
 Traceback (most recent call last):
   File "", line 1, in 
   File "/tmp/venv/lib/python2.7/site-packages/django/template/base.py",
 line 191, in __init__
 self.nodelist = self.compile_nodelist()
   File "/tmp/venv/lib/python2.7/site-packages/django/template/base.py",
 line 233, in compile_nodelist
 e.template_debug = self.get_exception_info(e, e.token)
 AttributeError: 'exceptions.OverflowError' object has no attribute 'token'
 }}}

 This is happening because `'inf'` is used in Python to represent infinity:

 {{{#!python
 >>> float('inf')
 inf
 }}}


 The problem appears to be with
 [https://github.com/django/django/blob/1.11.6/django/template/base.py#L809-L819
 this bit of the code]:
 {{{#!python
 # First try to treat this variable as a number.
 #
 # Note that this could cause an OverflowError here that we're
 not
 # catching. Since this should only happen at compile time,
 that's
 # probably OK.
 self.literal = float(var)

 # So it's a float... is it an int? If the original value
 contained a
 # dot or an "e" then it was a float, not an int.
 if '.' not in var and 'e' not in var.lower():
 self.literal = int(self.literal)
 }}}

 It successfully converts the string `'inf'` to a float with value of
 infinity, but then trying to convert this float to an int causes the
 OverflowError:

 {{{#!python
 >>> int(float('inf'))
 Traceback (most recent call last):
   File "", line 1, in 
 OverflowError: cannot convert float infinity to integer
 }}}

 Python also supports floats of `'-inf'` and `'nan'`. Using `'-inf'` as a
 template variable name doesn't work because it isn't a valid variable
 name. Using `'nan'` as a template variable name works OK:

 {{{#!python
 >>> Template('{{ nan }}').render(Context({'nan': 'xxx'}))
 u'xxx'
 }}}

 I think the fix is to allow variables named **inf**, rather than to
 support using **inf** as a float literal within templates.

-- 
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/050.2e14334d8ff7aa678a3ed964646ed5dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #23260: unordered_list filter doesn't work with generators

2017-10-18 Thread Django
#23260: unordered_list filter doesn't work with generators
-+-
 Reporter:  Jaap Roes|Owner:  Jaap Roes
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"b21b1b10af0bbe0498193881520efb02897bd444" b21b1b10]:
 {{{
 #!CommitTicketReference repository=""
 revision="b21b1b10af0bbe0498193881520efb02897bd444"
 Refs #23260 -- Tested nested generator input to unordered_list template
 filter.
 }}}

-- 
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/063.c115460f3af74805cc3228cc7097f08e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19295: Document that runserver --insecure doesn't work with DEBUG False and CachedStaticFilesStorage

2017-10-18 Thread Django
#19295: Document that runserver --insecure doesn't work with DEBUG False and
CachedStaticFilesStorage
-+-
 Reporter:  Apreche  |Owner:  Keith
 Type:   |  Edmiston
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"4a861e88508eacdb8d0d5bc43f9a0576cedb9f22" 4a861e88]:
 {{{
 #!CommitTicketReference repository=""
 revision="4a861e88508eacdb8d0d5bc43f9a0576cedb9f22"
 Refs #19295 -- Doc'd that ManifestStaticFilesStorage doesn't work with
 runserver --insecure.
 }}}

-- 
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/065.e69592ae154e5c4634d51eb21802af55%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19295: Document that runserver --insecure doesn't work with DEBUG False and CachedStaticFilesStorage

2017-10-18 Thread Django
#19295: Document that runserver --insecure doesn't work with DEBUG False and
CachedStaticFilesStorage
-+-
 Reporter:  Apreche  |Owner:  Keith
 Type:   |  Edmiston
  Cleanup/optimization   |   Status:  closed
Component:  Documentation|  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"36b4def91597d522fa73f9b3cb7d0530fe34bc62" 36b4def9]:
 {{{
 #!CommitTicketReference repository=""
 revision="36b4def91597d522fa73f9b3cb7d0530fe34bc62"
 [2.0.x] Refs #19295 -- Doc'd that ManifestStaticFilesStorage doesn't work
 with runserver --insecure.

 Backport of 4a861e88508eacdb8d0d5bc43f9a0576cedb9f22 from master
 }}}

-- 
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/065.5d1a0b5c2e076b7772198b8b90288d59%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28198: Model attributes shouldn't override deferred fields

2017-10-18 Thread Django
#28198: Model attributes shouldn't override deferred fields
-+-
 Reporter:  Ryan Hiebert |Owner:
 |  Denis.Tarykin
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ryan Hiebert):

 * stage:  Accepted => Ready for checkin


Comment:

 I've tested the patch against the {{{auth.User}}} issue mentioned
 initially, and have reviewed the patch. It looks good to me, so I hope
 it's acceptable for me to mark it as Ready for Checkin, despite being the
 one who opened the issue. I anticipate that it would be appropriate to
 backport to supported versions of Django.

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


Re: [Django] #23260: unordered_list filter doesn't work with generators

2017-10-18 Thread Django
#23260: unordered_list filter doesn't work with generators
-+-
 Reporter:  Jaap Roes|Owner:  Jaap Roes
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"673427d3fca2a6635d067d01c01fd42fc1a1ab76" 673427d3]:
 {{{
 #!CommitTicketReference repository=""
 revision="673427d3fca2a6635d067d01c01fd42fc1a1ab76"
 [2.0.x] Refs #23260 -- Tested nested generator input to unordered_list
 template filter.

 Backport of b21b1b10af0bbe0498193881520efb02897bd444 from master
 }}}

-- 
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/063.94167fa0652d633d8a9b9376ce42a693%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28711: unordered_list template filter does not work with lazy translations

2017-10-18 Thread Django
#28711: unordered_list template filter does not work with lazy translations
-+
 Reporter:  Jonas Haag   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Tim Graham ):

 In [changeset:"a831e4bad0e5f616680955dfd63a38fa49d8086b" a831e4b]:
 {{{
 #!CommitTicketReference repository=""
 revision="a831e4bad0e5f616680955dfd63a38fa49d8086b"
 [2.0.x] Fixed #28711 -- Fixed unordered_list template filter with lazy
 translations.

 Backport of d997ab776477dd9ecb158229b2622c7f1ed93dfb from master
 }}}

-- 
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/067.1b5e3ea8682f4b275edea73b546f7422%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28690: django.utils.http.parse_http_date two digit year check is incorrect

2017-10-18 Thread Django
#28690: django.utils.http.parse_http_date two digit year check is incorrect
-+-
 Reporter:  Mads Jensen  |Owner:  Alexander
 |  Vyushkov
 Type:  Bug  |   Status:  assigned
Component:  Utilities|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1


-- 
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/068.1efd8c32b0827528ce3b8091cd08ac8c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28575: Allow pickling dynamically created Model exception classes (DoesNotExist, MultipleObjectsReturned, RelatedObjectDoesNotExist)

2017-10-18 Thread Django
#28575: Allow pickling dynamically created Model exception classes 
(DoesNotExist,
MultipleObjectsReturned, RelatedObjectDoesNotExist)
-+-
 Reporter:  Rachel Tobin |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

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


-- 
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/065.b2aa111a4e5db91fc854d0e02ca760b1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28711: unordered_list template filter does not work with lazy translations

2017-10-18 Thread Django
#28711: unordered_list template filter does not work with lazy translations
-+
 Reporter:  Jonas Haag   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"d997ab776477dd9ecb158229b2622c7f1ed93dfb" d997ab7]:
 {{{
 #!CommitTicketReference repository=""
 revision="d997ab776477dd9ecb158229b2622c7f1ed93dfb"
 Fixed #28711 -- Fixed unordered_list template filter with lazy
 translations.
 }}}

-- 
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/067.5cd1c527109879c18099b54ab94c7859%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28712: Add ability to apply separate attributes to ChoiceWidget options

2017-10-18 Thread Django
#28712: Add ability to apply separate attributes to ChoiceWidget options
-+-
 Reporter:  Stephen Swatman  |Owner:  Stephen
 |  Swatman
 Type:  New feature  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  ChoiceWidget | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Stephen Swatman):

 Replying to [comment:4 Tim Graham]:
 > As for the case of styling, wouldn't it involve less markup to set a
 class on the `` and use a CSS selector (e.g. `select.super option
 {...}`) for that? If anything, I'd think we'd want a way to specify a
 different attribute value for each `` value -- setting the same
 key/value on every `` doesn't seem like something to encourage.

 You're right that the implementation in the PR was not very powerful. I
 have now expanded the PR to allow for callable attribute values. This
 would allow developers a lot of control over the attributes of each
 option.

-- 
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.22f6d944acdda03ae9f6997abe68cff5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28711: unordered_list template filter does not work with lazy translations

2017-10-18 Thread Django
#28711: unordered_list template filter does not work with lazy translations
-+
 Reporter:  Jonas Haag   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by Tim Graham ):

 In [changeset:"1399f8ae77f78c5dc8461fe1604d2a58219aa298" 1399f8a]:
 {{{
 #!CommitTicketReference repository=""
 revision="1399f8ae77f78c5dc8461fe1604d2a58219aa298"
 Refs #28711 -- Replaced ugettext_lazy() with gettext_lazy() in a test.

 As per c651331b34b7c3841c126959e6e52879bc6f0834.
 }}}

-- 
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/067.4dde23cac506a64e794a8b05902c3451%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28575: Allow pickling dynamically created Model exception classes (DoesNotExist, MultipleObjectsReturned, RelatedObjectDoesNotExist)

2017-10-18 Thread Django
#28575: Allow pickling dynamically created Model exception classes 
(DoesNotExist,
MultipleObjectsReturned, RelatedObjectDoesNotExist)
-+-
 Reporter:  Rachel Tobin |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham ):

 In [changeset:"d4fb742094dba99cb0db17f3aa9d9f5159af676f" d4fb7420]:
 {{{
 #!CommitTicketReference repository=""
 revision="d4fb742094dba99cb0db17f3aa9d9f5159af676f"
 Refs #28575 -- Made RelatedObjectDoesNotExist classes pickable.

 Thanks to Rachel Tobin for the initial __qualname__ work and tests.
 }}}

-- 
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/065.cfa77db5ec2c9e3956ba8ee8d8e52212%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
-+
 Reporter:  Fraser Nevett|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


-- 
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/065.bade184c33c4716c980e0320aeeab506%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28722: reverse_ordering does not reverse nulls_first/nulls_last

2017-10-18 Thread Django
#28722: reverse_ordering does not reverse nulls_first/nulls_last
-+-
 Reporter:  Tomer Chachamu   |Owner:  Tomer
 |  Chachamu
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tomer Chachamu):

 * has_patch:  0 => 1


-- 
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/063.1c641840f950ae04f95ec9af7cbfec1b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28720: Add HttpRequest.get_full_path_info() (was: Add HttpRequest.get_full_path_info)

2017-10-18 Thread Django
#28720: Add HttpRequest.get_full_path_info()
---+
 Reporter:  Jonas Haag |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  HTTP handling  |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


Old description:

> `HttpRequest.get_full_path` returns the `HttpRequest.path` based full
> path, including query string. Example: `/posts/12345/?foo=bar`.
>
> We should add a counterpart for `HttpRequest.path_info` that includes the
> `SCRIPT_NAME`, if set. Example: `/scriptname/posts/12345/?foo=bar`
>
> Example use case: Adding hreflang meta tags to your `` section.
> This must include the `SCRIPT_NAME` prefix as well, otherwise invalid
> URLs are given.
>
> {{{
> https://yourdomain.com{{
> request.get_full_path_info }}">
> }}}
>
> Patch: https://github.com/django/django/pull/9253

New description:

 `HttpRequest.get_full_path()` returns the `HttpRequest.path` based full
 path, including query string. Example: `/posts/12345/?foo=bar`.

 We should add a counterpart for `HttpRequest.path_info()` that includes
 the `SCRIPT_NAME`, if set. Example: `/scriptname/posts/12345/?foo=bar`

 Example use case: Adding hreflang meta tags to your `` section. This
 must include the `SCRIPT_NAME` prefix as well, otherwise invalid URLs are
 given.

 {{{
 https://yourdomain.com{{
 request.get_full_path_info }}">
 }}}

 [https://github.com/django/django/pull/9253 PR]

--

-- 
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/067.4c6857f693e389d520513f68a59e30a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28722: reverse_ordering does not reverse nulls_first/nulls_last

2017-10-18 Thread Django
#28722: reverse_ordering does not reverse nulls_first/nulls_last
-+-
   Reporter:  Tomer  |  Owner:  Tomer Chachamu
  Chachamu   |
   Type:  Bug| Status:  assigned
  Component:  Database   |Version:  1.11
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 The documentation for Expression.reverse_ordering says it is its own
 inverse:

 
https://docs.djangoproject.com/en/1.11/ref/models/expressions/#django.db.models.Expression.reverse_ordering

 > Returns self with any modifications required to reverse the sort order
 within an order_by call. As an example, an expression implementing NULLS
 LAST would change its value to be NULLS FIRST. Modifications are only
 required for expressions that implement sort order like OrderBy. This
 method is called when reverse() is called on a queryset.

 However, this isn't implemented.
 
https://github.com/django/django/blob/2b5a511bd9fbd67cedf72b8d39b9522c0140d023/django/db/models/expressions.py#L1133

-- 
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/048.3ef3c6cf54a2c34acc01e2506822101f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28722: reverse_ordering does not reverse nulls_first/nulls_last

2017-10-18 Thread Django
#28722: reverse_ordering does not reverse nulls_first/nulls_last
-+-
 Reporter:  Tomer Chachamu   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tomer Chachamu):

 * status:  assigned => new
 * owner:  Tomer Chachamu => (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/063.fab03eb317d25c648238618e2e30246f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28703: URL regex for admin's app_index view isn't constructed deterministically

2017-10-18 Thread Django
#28703: URL regex for admin's app_index view isn't constructed deterministically
--+
 Reporter:  Erik Bryant   |Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  contrib.admin |  Version:  1.11
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham):

 * keywords:  stable =>
 * stage:  Unreviewed => Accepted


Comment:

 I think that change could be made separately without a ticket.

-- 
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/068.7fe7ba9fb5afaf1317d70e70e4e66452%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
-+--
 Reporter:  Fraser Nevett|Owner:  Levi Payne
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Levi Payne):

 * owner:  nobody => Levi Payne
 * 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/065.ec3b6cc3129748edfb00f08ab5912979%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #20535: Unnecessary join created for intermediate table between two M2M tables

2017-10-18 Thread Django
#20535: Unnecessary join created for intermediate table between two M2M tables
-+-
 Reporter:  German M. Bravo  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Zach):

 * cc: Zach (added)


-- 
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/064.884ea50a7daf4161e0861b1db4a13605%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28722: QuerySet.reverse() doesn't reverse nulls_first/nulls_last (was: reverse_ordering does not reverse nulls_first/nulls_last)

2017-10-18 Thread Django
#28722: QuerySet.reverse() doesn't reverse nulls_first/nulls_last
-+-
 Reporter:  Tomer Chachamu   |Owner:  (none)
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.11
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted


-- 
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/063.196170c8c0958011f2de8710187a8b97%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
-+--
 Reporter:  Fraser Nevett|Owner:  Levi Payne
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Levi Payne):

 [https://github.com/django/django/pull/9258 WIP Pull Request]

-- 
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/065.b64e97318a928a0c322337e96dbf3741%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
-+--
 Reporter:  Fraser Nevett|Owner:  Levi Payne
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Levi Payne):

 Pull Request is ready for review.

-- 
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/065.e979fb21a93e75bb293aa6eee5710922%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28721: Cannot use the variable name "inf" in templates

2017-10-18 Thread Django
#28721: Cannot use the variable name "inf" in templates
-+--
 Reporter:  Fraser Nevett|Owner:  Levi Payne
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.11
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by Levi Payne):

 * has_patch:  0 => 1


-- 
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/065.e96e1a097305fe83247fa1ab12314f9e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name

2017-10-18 Thread Django
#28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name
-+-
   Reporter:  Mike   |  Owner:  nobody
  Hansen |
   Type: | Status:  new
  Uncategorized  |
  Component:  Database   |Version:  master
  layer (models, ORM)|
   Severity:  Normal |   Keywords:
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 Currently, `RelatedManager.get_prefetch_queryset` returns
 `self.field.related_query_name()` as the `cache_name`.  In the case where
 no `related_name` has been set on the `ForeignKey`, then this does not
 match with the `through_attr` used by `get_prefetcher`.

 Using the models in `tests/prefetch_related/models.py`,

 {{{#!python
 BookWithYear.objects.prefetch_related('bookreview_set')
 }}}
 will use a `through_attr` of `bookreview_set`, but `bookreview` is what
 will be placed in `_prefetched_objects_cache`.

 I think `related_manager.field.remote_field.get_accessor_name()` should be
 used instead.

 I'll post a patch fixing this and adding a test case.

-- 
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/051.73416c10f42becc141cb2371e8260a3c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28712: Add ability to apply separate attributes to ChoiceWidget options

2017-10-18 Thread Django
#28712: Add ability to apply separate attributes to ChoiceWidget options
-+--
 Reporter:  Stephen Swatman  |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  ChoiceWidget | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by Stephen Swatman):

 Replying to [comment:1 Tim Graham]:
 > Could you describe your use case in more detail? Is there a reason that
 overriding `ChoiceWidget.create_option()` wouldn't work?

 Web developers may want to individually style each option in a
 `ChoiceWidget`, be it by adding CSS classes or style attributes. This may
 be done to add images to such a widget to make it more appealing to the
 user. Developers may also want to add ARIA properties to the options or
 add additional information to work with them via JavaScript.

 It would absolutely be possible to override the `ChoiceWidget` class and
 modifying the `create_option()` method. I imagine, however, that this is a
 common enough use case to warrant a simpler method of doing this. Here are
 some people on StackOverflow having the same issue:

 * https://stackoverflow.com/questions/6477856/how-to-add-attributes-to-
 option-tags-in-django
 * https://stackoverflow.com/questions/43524214/django-add-attributes-to-
 selectmultiple-option-tags
 * https://stackoverflow.com/questions/5089396/django-form-field-choices-
 adding-an-attribute

-- 
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.61641e80d297b7c0e9ca9e1c59e7bda4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name

2017-10-18 Thread Django
#28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name
-+-
 Reporter:  Mike Hansen  |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mike Hansen):

 * has_patch:  0 => 1


Comment:

 A pull request for this can be found at
 https://github.com/django/django/pull/9259

 I wasn't sure on the best location for these tests so any guidance would
 be helpful.

-- 
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/066.8385d53a3992a85d83cdadec107477c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28724: QuerySet filter across m2m returns incorrect number of objects

2017-10-18 Thread Django
#28724: QuerySet filter across m2m returns incorrect number of objects
---+--
 Reporter:  Zach   |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Uncategorized  |  Version:  1.11
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Tim Graham):

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


Comment:

 This is expected behavior as per
 [https://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-
 valued-relationships Spanning multi-valued relationships].

-- 
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/067.55973f686dc7219f17370b9bf59bf951%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name

2017-10-18 Thread Django
#28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name
-+-
 Reporter:  Mike Hansen  |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Mike Hansen:

Old description:

> Currently, `RelatedManager.get_prefetch_queryset` returns
> `self.field.related_query_name()` as the `cache_name`.  In the case where
> no `related_name` has been set on the `ForeignKey`, then this does not
> match with the `through_attr` used by `get_prefetcher`.
>
> Using the models in `tests/prefetch_related/models.py`,
>
> {{{#!python
> BookWithYear.objects.prefetch_related('bookreview_set')
> }}}
> will use a `through_attr` of `bookreview_set`, but `bookreview` is what
> will be placed in `_prefetched_objects_cache`.
>
> I think `related_manager.field.remote_field.get_accessor_name()` should
> be used instead.
>
> I'll post a patch fixing this and adding a test case.

New description:

 Currently, `RelatedManager.get_prefetch_queryset` returns
 `self.field.related_query_name()` as the `cache_name`.  In the case where
 no `related_name` has been set on the `ForeignKey`, then this does not
 match with the `through_attr` used by `get_prefetcher`.

 Using the models in `tests/prefetch_related/models.py`,

 {{{#!python
 BookWithYear.objects.prefetch_related('bookreview_set')
 }}}
 will use a `through_attr` of `"bookreview_set"`, but `"bookreview"` is
 what will be placed in `_prefetched_objects_cache`.

 I think `related_manager.field.remote_field.get_accessor_name()` should be
 used instead.

 I'll post a patch fixing this and adding a test case.

--

-- 
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/066.3170a9a754813e50bd9bd4b4cac07e10%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28712: Add ability to apply separate attributes to ChoiceWidget options

2017-10-18 Thread Django
#28712: Add ability to apply separate attributes to ChoiceWidget options
-+-
 Reporter:  Stephen Swatman  |Owner:  Stephen
 |  Swatman
 Type:  New feature  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  ChoiceWidget | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Tim Graham):

 As for the case of styling, wouldn't it involve less markup to set a class
 on the `` and use a CSS selector (e.g. `select.super option
 {...}`) for that? If anything, I'd think we'd want a way to specify a
 different attribute value for each `` value -- setting the same
 key/value on every `` doesn't seem like something to encourage.

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


[Django] #28724: QuerySet filter across m2m returns incorrect number of objects

2017-10-18 Thread Django
#28724: QuerySet filter across m2m returns incorrect number of objects
-+
   Reporter:  Zach   |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Uncategorized  |Version:  1.11
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  0
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 {{{#!python
 # models
 from django.db import models

 class ProductArea(models.Model):
   name = models.CharField(max_length=100)

 class Product(models.Model):
   name = models.CharField(max_length=100)
   product_areas = models.ManyToManyField(ProductArea,
 through='Relationship')

 class MembershipLevel(models.Model):
   name = models.CharField(max_length=100)

 class Relationship(models.Model):
   product = models.ForeignKey(Product)
   product_area = models.ForeignKey(ProductArea)
   membership_level = models.ForeignKey(MembershipLevel)
 }}}

 {{{#!python
 from myapp.models import MembershipLevel
 from myapp.models import ProductArea
 from myapp.models import Relationship
 from myapp.models import Product

 p1, _ = Product.objects.get_or_create(name='My Product')
 p2, _ = Product.objects.get_or_create(name='Another Product')
 p3, _ = Product.objects.get_or_create(name='Yet another product')

 a1, _ = ProductArea.objects.get_or_create(name='Air')
 a2, _ = ProductArea.objects.get_or_create(name='Land')
 a3, _ = ProductArea.objects.get_or_create(name='Sea')

 m1, _ = MembershipLevel.objects.get_or_create(name='gold')
 m2, _ = MembershipLevel.objects.get_or_create(name='bronze')
 m3, _ = MembershipLevel.objects.get_or_create(name='silver')

 Relationship.objects.get_or_create(product=p1, product_area=a1,
 membership_level=m1)
 Relationship.objects.get_or_create(product=p1, product_area=a2,
 membership_level=m2)
 Relationship.objects.get_or_create(product=p1, product_area=a3,
 membership_level=m3)
 Relationship.objects.get_or_create(product=p2, product_area=a1,
 membership_level=m1)
 Relationship.objects.get_or_create(product=p2, product_area=a2,
 membership_level=m2)
 Relationship.objects.get_or_create(product=p2, product_area=a3,
 membership_level=m3)
 Relationship.objects.get_or_create(product=p3, product_area=a1,
 membership_level=m1)
 Relationship.objects.get_or_create(product=p3, product_area=a2,
 membership_level=m2)
 Relationship.objects.get_or_create(product=p3, product_area=a3,
 membership_level=m3)

 # "total found: 3".
 print('total found: %s' % Product.objects.count())

 # "total with filter found: 9".
 print('total with filter found: %s' %
 
Product.objects.filter(product_areas__relationship__membership_level__name='gold').count())
 }}}

-- 
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/052.e493882093f98cefbce4780079afca63%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name

2017-10-18 Thread Django
#28723: RelatedManager.get_prefetch_queryset returns "wrong" cache_name
-+-
 Reporter:  Mike Hansen  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  master
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Mike Hansen):

 * type:  Uncategorized => Bug


Old description:

> Currently, `RelatedManager.get_prefetch_queryset` returns
> `self.field.related_query_name()` as the `cache_name`.  In the case where
> no `related_name` has been set on the `ForeignKey`, then this does not
> match with the `through_attr` used by `get_prefetcher`.
>
> Using the models in `tests/prefetch_related/models.py`,
>
> {{{#!python
> BookWithYear.objects.prefetch_related('bookreview_set')
> }}}
> will use a `through_attr` of `"bookreview_set"`, but `"bookreview"` is
> what will be placed in `_prefetched_objects_cache`.
>
> I think `related_manager.field.remote_field.get_accessor_name()` should
> be used instead.
>
> I'll post a patch fixing this and adding a test case.

New description:

 Currently, `RelatedManager.get_prefetch_queryset` returns
 `self.field.related_query_name()` as the `cache_name`.  In the case where
 no `related_name` has been set on the `ForeignKey`, then this does not
 match with the `through_attr` used by `get_prefetcher`.

 Using the models in `tests/prefetch_related/models.py`,

 {{{#!python
 BookWithYear.objects.prefetch_related('bookreview_set')
 }}}
 will use a `through_attr` of `"bookreview_set"`, but `"bookreview"` is
 what will be placed in `_prefetched_objects_cache`.

 I think `related_manager.field.remote_field.get_accessor_name()` should be
 used instead.

 https://github.com/django/django/pull/9259 is a pull request which fixes
 this issue

--

-- 
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/066.b78d86a9724e6e205f969657f2e67f25%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #28712: Add ability to apply separate attributes to ChoiceWidget options

2017-10-18 Thread Django
#28712: Add ability to apply separate attributes to ChoiceWidget options
-+-
 Reporter:  Stephen Swatman  |Owner:  Stephen
 |  Swatman
 Type:  New feature  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  ChoiceWidget | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Stephen Swatman):

 * owner:  nobody => Stephen Swatman
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 Proposed PR: https://github.com/django/django/pull/9260

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