Re: [Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
-+-
 Reporter:  c0ntribut0r  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.9
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  list_editable| Triage Stage:
  pagination cl.result_list  |  Unreviewed
  queryset   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by c0ntribut0r):

 I've investigated. It was because I didn't set up ordering like {{{
 ordering = ['-id'] }}}. The ordering was undefined for each page slice
 which led to these kind of errors.

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


Re: [Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
-+-
 Reporter:  c0ntribut0r  |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.9
 Severity:  Normal   |   Resolution:  duplicate
 Keywords:  list_editable| Triage Stage:
  pagination cl.result_list  |  Unreviewed
  queryset   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

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


Comment:

 Duplicate of #11313. Could you test the
 [https://github.com/django/django/pull/5686 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/069.606623635b0555bb4de397878c2ff583%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
-+-
 Reporter:  c0ntribut0r  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.9
 Severity:  Normal   |   Resolution:
 Keywords:  list_editable| Triage Stage:
  pagination cl.result_list  |  Unreviewed
  queryset   |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by c0ntribut0r):

 * keywords:   => list_editable pagination cl.result_list queryset
 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 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/069.72e9672ec51649a0393234c9276c8273%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
---+
 Reporter:  c0ntribut0r|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.9
 Severity:  Normal | Resolution:
 Keywords: |   Triage Stage:  Unreviewed
Has patch:  1  |  Easy pickings:  0
UI/UX:  0  |
---+
Changes (by c0ntribut0r):

 * Attachment "project.tar.gz" added.

 Sample project for quick testing (sqlite)

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


Re: [Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
---+
 Reporter:  c0ntribut0r|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.9
 Severity:  Normal | Resolution:
 Keywords: |   Triage Stage:  Unreviewed
Has patch:  1  |  Easy pickings:  0
UI/UX:  0  |
---+
Changes (by c0ntribut0r):

 * Attachment "diff.txt" 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/069.c6494fbed278ab1f02cffe0a768b37de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #25919: Wrong behavior after saving on changelist page when any field is list_editable

2015-12-11 Thread Django
#25919: Wrong behavior after saving on changelist page when any field is
list_editable
---+
 Reporter:  c0ntribut0r|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.9
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+
 Assume there is a simple model
 {{{
 class SomeModel(models.Model):
 name = models.CharField('name', max_length=64)
 }}}
 and simple admin for it (note 2 items per page and in-line editable field
 "name")
 {{{
 @admin.register(SomeModel)
 class SomeModelAdmin(admin.ModelAdmin):
 list_display = ['id' ,'name']
 list_editable = ['name']
 list_per_page = 2
 }}}
 Go to admin page and create two instances of SomeModel with names, say,
 "alpha" and "beta". Then, open the same admin page
 ({{{/admin/testapp/somemodel/}}}) in another browser tab and create
 another instance ("gamma"). Return to the first tab (it's of course
 unchanged and there still remain "alpha" and "beta" instances) and change
 in-line field "name" from "alpha" to "lambda" and press "save". Then press
 "show all" and you'll see that you haven't changed "alpha" to "lambda" -
 you created new instance "lambda", and "alpha" also remains there!

 The source of this bug is in {{{ django/contrib/admin/options.py }}}:
 {{{
 # Handle POSTed bulk-edit data.
 if (request.method == "POST" and cl.list_editable and
 '_save' in request.POST and not action_failed):
 FormSet = self.get_changelist_formset(request)
 formset = cl.formset = FormSet(request.POST, request.FILES,
 queryset=cl.result_list)
 }}}
 When user clicks "save", the page sends correct POST data like this:
 {{{
 "form-0-id" = "0",
 "form-0-name" = "beta",
 "form-1-id" = "1",
 "form-1-name" = "lambda"  <-- was "alpha" before
 }}}
 But there is code ({{{ queryset=cl.result_list }}}) which restricts form's
 instances to those that are on current admin page ({{{
 /admin/testapp/somemodel/ }}}). As you remember, we have 3 instances -
 "alpha", "beta", "gamma", and according to {{{ list_per_page = 2 }}} only
 last two instances are shown - these are "beta" and "gamma".

 When the form's POST data ("beta", "alpha -> lambda") fits instances from
 queryset ("beta", "gamma"), it finds "beta" and changes it without errors,
 but it cannot find "alpha" and change it - so it thinks that we added new
 record and creates an instance with value "lambda". This is not a desired
 behavior.

 Removing the queryset restriction solves this problem. I am wondering
 whether that queryset was there at all.

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