Re: [Django] #27331: Proposed opt_group argument for ModelChoiceField and ModelMultipleChoiceField

2016-10-09 Thread Django
#27331: Proposed opt_group argument for ModelChoiceField and
ModelMultipleChoiceField
-+-
 Reporter:  Héctor Urbina|Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  ModelChoiceField | Triage Stage:
  optgroup   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Héctor Urbina):

 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Old description:

> Hello,
>
> I've just implemented this and I thought It could well be incorporated
> into Django itself; I guess it's a fairly common feature that one may
> need on any project.
>
> What I propose is to add a `opt_group` argument to ModelChoiceField and
> ModelMultipleChoiceField; which indicates the item's field whose value is
> used to group the choices. It should be used in conjunction with a
> queryset which is (primarily) sorted by the same field.
>
> Let me show with an example:
> {{{
> #!python
> class Category(models.Model):
> name = models.CharField(max_length=20)
>
> class Item(models.Model):
> name = models.CharField(max_length=20)
> category = models.ForeignKey(Category)
> }}}
> And in some form's initialization process
> {{{
> #!python
> field = ModelChoiceField(queryset=Item.objects.order_by('category__name',
> 'name'), opt_group='category')
> }}}
> field.choices will dynamically collect choices into named groups as a
> 2-tuple, which the underlying widget should present using an optgroup
> HTML element.

New description:

 Hello,

 I've just implemented this and I thought It could well be incorporated
 into Django itself; I guess it's a fairly common feature that one may need
 on any project.

 What I propose is to add a `opt_group` argument to ModelChoiceField and
 ModelMultipleChoiceField; which indicates the item's field whose value is
 used to group the choices. It should be used in conjunction with a
 queryset which is (primarily) sorted by the same field.

 Let me show with an example:
 {{{
 #!python
 class Category(models.Model):
 name = models.CharField(max_length=20)

 class Item(models.Model):
 name = models.CharField(max_length=20)
 category = models.ForeignKey(Category)
 }}}
 And in some form's initialization process
 {{{
 #!python
 field = ModelChoiceField(queryset=Item.objects.order_by('category__name',
 'name'), opt_group='category')
 }}}
 `field.choices` will dynamically collect choices into named groups as a
 2-tuple, which the underlying widget should present using `optgroup` HTML
 elements.

--

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


[Django] #27331: Proposed opt_group argument for ModelChoiceField and ModelMultipleChoiceField

2016-10-09 Thread Django
#27331: Proposed opt_group argument for ModelChoiceField and
ModelMultipleChoiceField
---+---
 Reporter:  Héctor Urbina  |  Owner:  nobody
 Type:  New feature| Status:  new
Component:  Forms  |Version:  master
 Severity:  Normal |   Keywords:  ModelChoiceField optgroup
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+---
 Hello,

 I've just implemented this and I thought It could well be incorporated
 into Django itself; I guess it's a fairly common feature that one may need
 on any project.

 What I propose is to add a `opt_group` argument to ModelChoiceField and
 ModelMultipleChoiceField; which indicates the item's field whose value is
 used to group the choices. It should be used in conjunction with a
 queryset which is (primarily) sorted by the same field.

 Let me show with an example:
 {{{
 #!python
 class Category(models.Model):
 name = models.CharField(max_length=20)

 class Item(models.Model):
 name = models.CharField(max_length=20)
 category = models.ForeignKey(Category)
 }}}
 And in some form's initialization process
 {{{
 #!python
 field = ModelChoiceField(queryset=Item.objects.order_by('category__name',
 'name'), opt_group='category')
 }}}
 field.choices will dynamically collect choices into named groups as a
 2-tuple, which the underlying widget should present using an optgroup HTML
 element.

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


Re: [Django] #27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

2016-10-09 Thread Django
#27330: Generic CreateView/UpdateView doesn't send the kwargs to 
get_context_data
-+-
 Reporter:  Dorian Amouroux  |Owner:  Aleksandr
 |  Sobolev
 Type:  Bug  |   Status:  assigned
Component:  Generic views|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Dorian Amouroux):

 I have hard time to follow the decision around it. I can't find in the
 documentation the new way to send additional information to generic view.
 Replying to [comment:2 Simon Charette]:
 > Quoting Tim on #21964:
 >
 > > pushing `kwargs` to the context has been called an anti-pattern in
 #19878 and we're planning to deprecate that behavior in TemplateView.

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


Re: [Django] #27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

2016-10-09 Thread Django
#27330: Generic CreateView/UpdateView doesn't send the kwargs to 
get_context_data
-+-
 Reporter:  Dorian Amouroux  |Owner:  Aleksandr
 |  Sobolev
 Type:  Bug  |   Status:  assigned
Component:  Generic views|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Simon Charette):

 Quoting Tim on #21964:

 > pushing `kwargs` to the context has been called an anti-pattern in
 #19878 and we're planning to deprecate that behavior in TemplateView.

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


Re: [Django] #27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

2016-10-09 Thread Django
#27330: Generic CreateView/UpdateView doesn't send the kwargs to 
get_context_data
-+-
 Reporter:  Dorian Amouroux  |Owner:  Aleksandr
 |  Sobolev
 Type:  Bug  |   Status:  assigned
Component:  Generic views|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Aleksandr Sobolev):

 * status:  new => assigned
 * needs_better_patch:   => 0
 * owner:  nobody => Aleksandr Sobolev
 * needs_tests:   => 0
 * needs_docs:   => 0


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


[Django] #27330: Generic CreateView/UpdateView doesn't send the kwargs to get_context_data

2016-10-09 Thread Django
#27330: Generic CreateView/UpdateView doesn't send the kwargs to 
get_context_data
-+
 Reporter:  Dorian Amouroux  |  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Generic views|Version:  1.10
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  1
Easy pickings:  1|  UI/UX:  0
-+
 I noticed that the generic classes CreateView and UpdateView doesn't
 inject the kwargs into the `get_context_data()` method.

 We can see here
 
https://github.com/django/django/blob/stable/1.10.x/django/views/generic/edit.py#L174
 that the methods `get` and `post` call `get_context_data` without
 `**kwargs` in parameter.

 I couldn't find a reason for that.

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


Re: [Django] #24423: Combine i18n template tag tests

2016-10-09 Thread Django
#24423: Combine i18n template tag tests
-+-
 Reporter:  Preston Timmons  |Owner:  Aleksandr
 Type:   |  Sobolev
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  master
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Aleksandr Sobolev):

 Sorry, my fault. Next time I'll avoid such mistakes.

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


Re: [Django] #24423: Combine i18n template tag tests

2016-10-09 Thread Django
#24423: Combine i18n template tag tests
-+-
 Reporter:  Preston Timmons  |Owner:  Aleksandr
 Type:   |  Sobolev
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  master
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Tim Graham):

 * has_patch:  0 => 1
 * stage:  Ready for checkin => Accepted


Comment:

 Thanks for the patch. The correct
 [https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
 tickets/ triage action] is to check "Has patch"' when adding a pull
 request. "Ready for checkin" is set by the person who reviews the patch.

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


Re: [Django] #27329: Django-river State field not showing

2016-10-09 Thread Django
#27329: Django-river State field not showing
-+-
 Reporter:  swati|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Uncategorized|  Version:  1.10
 Severity:  Release blocker  |   Resolution:  invalid
 Keywords:  django-river,| Triage Stage:
  #workflows |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Aymeric Augustin):

 * status:  new => closed
 * needs_docs:   => 0
 * resolution:   => invalid
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Comment:

 Please report this to django-river. It's a third-party project, not part
 of Django itself.

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


Re: [Django] #24423: Combine i18n template tag tests

2016-10-09 Thread Django
#24423: Combine i18n template tag tests
-+-
 Reporter:  Preston Timmons  |Owner:  Aleksandr
 Type:   |  Sobolev
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  master
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Aleksandr Sobolev):

 * stage:  Accepted => Ready for checkin


Comment:

 Create pull request with three commits:
 https://github.com/django/django/pull/7363

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


[Django] #27329: Django-river State field not showing

2016-10-09 Thread Django
#27329: Django-river State field not showing
-+--
 Reporter:  swati|  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Uncategorized|Version:  1.10
 Severity:  Release blocker  |   Keywords:  django-river, #workflows
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+--
 I am using django-river, with Python3.5 and Django 1.10

 While creating States on admin-panel, States are not getting created with
 their normal Label.
 Rather all states are getting created by "State object" name.

 Pls help.


 I am following the tutorial from
 https://www.youtube.com/watch?v=5EZGnTf39aI

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


Re: [Django] #24423: Combine i18n template tag tests

2016-10-09 Thread Django
#24423: Combine i18n template tag tests
-+-
 Reporter:  Preston Timmons  |Owner:  Aleksandr
 Type:   |  Sobolev
  Cleanup/optimization   |   Status:  assigned
Component:   |  Version:  master
  Internationalization   |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Aleksandr Sobolev):

 * owner:  nobody => Aleksandr Sobolev
 * 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/072.45553d3836942459a4d350f4674cf35a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #27328: return `Set-Cookie` if sessionid= None value

2016-10-09 Thread Django
#27328: return `Set-Cookie` if sessionid=  None value
--+
 Reporter:  Ramin Farajpour Cami  |  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  HTTP handling |Version:  1.10
 Severity:  Normal|   Keywords:
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+
 Hi,

 i use request AJAX, when i haven't sessionid i can send request i see
 response


 {{{
 POST http://IP/session HTTP/1.1
 Host: IP
 Connection: keep-alive
 Content-Length: 0
 Accept: application/json, text/javascript, */*; q=0.01
 Origin: http://IP
 X-Requested-With: XMLHttpRequest
 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36
 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
 X-CSRFToken: BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY
 Referer: http://172.16.20.141/ramin
 Accept-Encoding: gzip, deflate
 Accept-Language: en-US,en;q=0.8
 Cookie: sessionid=;csrftoken=BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY

 }}}

 you see here `Cookie:
 sessionid=;csrftoken=BF8nOVWsMJaX9Gi3aJijGSO97iTyLpNY` sessionid is `
 sessionid=` send to django server


 {{{
 HTTP/1.1 200 OK
 Date: Sun, 09 Oct 2016 08:17:15 GMT
 Content-Type: application/json
 Connection: keep-alive
 Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-Age=0;
 Path=/
 Content-Length: 18

 }}}

 set `Set-Cookie: sessionid=; expires=Thu, 01-Jan-1970 00:00:00 GMT; Max-
 Age=0; Path=/` in response django
 i see your code
 [https://github.com/django/django/blob/master/django/http/cookie.py#L74]
 in if `val` is empty , you need change `or` to `and`,

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