Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-08-31 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.10
 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 ljsjl):

 Huh, guess I should have followed my initial fix further down the rabbit
 hole to Field rather than ModelAdmin behaviour. Thanks to Wonder and Tim
 for a better fix.

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-08-31 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.10
 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:"20c03399d8fd03484f3ed33d93691c29c2ff5aaf" 20c0339]:
 {{{
 #!CommitTicketReference repository=""
 revision="20c03399d8fd03484f3ed33d93691c29c2ff5aaf"
 [1.11.x] Fixed #27998, #28543 -- Restored logging of ManyToManyField
 changes in admin's object history.

 And prevented ManyToManyField initial data in model forms from being
 affected
 by subsequent model changes.

 Regression in 56a55566a791a11420fe96f745b7489e756fc931.

 Partial backport of e5bd585c6eb1e13e2f8aac030b33c077b0b70c05 and
 15b465c584f49a1d43b6c18796f83521ee4ffc22 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.502ba84f52536ab0bf96eb656bd3bed8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-08-31 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.10
 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 GitHub ):

 In [changeset:"e5bd585c6eb1e13e2f8aac030b33c077b0b70c05" e5bd585]:
 {{{
 #!CommitTicketReference repository=""
 revision="e5bd585c6eb1e13e2f8aac030b33c077b0b70c05"
 Fixed #28543 -- Prevented ManyToManyField.value_from_object() from being
 lazy.

 Previously, it was a QuerySet which could reevaluate to a new value if the
 model's data changes. This is inconsistent with other
 Field.value_from_object()
 methods.

 This allows reverting the fix in the admin for refs #27998.
 }}}

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-08-30 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.10
 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):

 I found that this is a regression in Django 1.10 due to
 ded502024191053475bac811d365ac29dca1db61 and therefore should be fixed in
 the current stable branch, 1.11.x. The fix for #28543 fixes this issue in
 a better way (at the form level, rather than only in the admin) but I'm
 concerned that the approach I've proposed there, changing the return type
 of `ManyToManyField.value_from_object()`, is too risky for a stable
 release. I've proposed an [https://github.com/django/django/pull/8993
 alternate PR] that modifies `model_to_dict()` instead. It restores the
 behavior of `model_to_dict()` returning a list for `ManyToManyField` from
 before 67d984413c9540074e4fe6aa033081a35cf192bc.

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-06-14 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  closed
Component:  contrib.admin  |  Version:  1.10
 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:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"15b465c584f49a1d43b6c18796f83521ee4ffc22" 15b465c]:
 {{{
 #!CommitTicketReference repository=""
 revision="15b465c584f49a1d43b6c18796f83521ee4ffc22"
 Fixed #27998 -- Made ManyToManyField changes logged in admin's object
 history.
 }}}

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-05-06 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  1.10
 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


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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-04-25 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  1.10
 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 ljsjl):

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-04-05 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  ljsjl
 Type:  Bug|   Status:  assigned
Component:  contrib.admin  |  Version:  1.10
 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 ljsjl):

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


Comment:

 https://github.com/ljsjl/django/tree/ticket_27998

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


Re: [Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-04-01 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
---+
 Reporter:  ljsjl  |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.10
 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


Comment:

 If you're able to, submitting a pull request to GitHub is the best way to
 submit a 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/063.b1b95cacd26faeef5bbe6bb463f2cd99%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #27998: LogEntry messages do not list m2m fields that were changed when an object is changed via ModelAdmin

2017-03-30 Thread Django
#27998: LogEntry messages do not list m2m fields that were changed when an 
object
is changed via ModelAdmin
-+
   Reporter:  ljsjl  |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  contrib.admin  |Version:  1.10
   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  |
-+
 What I expect to happen: m2m fields that are changed via a ModelAdmin in
 an update are listed in the appropriate change message in that object's
 history.
 What happens: m2m fields are not listed in the generated change message

 Reproduction: Create a vanilla Django install. Create a group. Assign a
 permission to that group. View the group's history, the message will say
 "No fields changed."

 Cause: It looks like save_related() is called before form.has_changed() or
 form.changed_data are evaluated. save_related() calls form.save_m2m()
 which updates the relationship table. At this point it looks like
 querysets in the ModelForm form.initial have not been evaluated, so when
 they are evaluated as part of constructing the change message the database
 has already been modified by form.save_m2m(), and so the fields are left
 out of form.changed_data.

 Fix: Probably call form.has_changed() at some point before save_related().
 Happy to put together a patch for changelist_view and changeform_view if
 needed and attach to this 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/048.777327f0e0ed02103a1075cb30707d17%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.