Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-19 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+-
 Reporter:  jmfederico   |Owner:  MarkusH
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   Resolution:  fixed
 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
-+-

Comment (by Markus Holtermann <info@…>):

 In [changeset:"f64a3de2d4b623087c70405523a08a4e6043d102" f64a3de2]:
 {{{
 #!CommitTicketReference repository=""
 revision="f64a3de2d4b623087c70405523a08a4e6043d102"
 [1.8.x] Fixed #24940 -- Made model managers hashable

 Thanks Federico Jaramillo Martínez for the report and Tim Graham for the
 test and review.

 Backport of d3d66d47222dd8765a20a15fdc754c0ed7635404 from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:6>
Django <https://code.djangoproject.com/>
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.87c749ef85982e3eb35fb442077e92aa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-19 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+-
 Reporter:  jmfederico   |Owner:  MarkusH
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   Resolution:  fixed
 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 Markus Holtermann <info@…>):

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


Comment:

 In [changeset:"d3d66d47222dd8765a20a15fdc754c0ed7635404" d3d66d4]:
 {{{
 #!CommitTicketReference repository=""
 revision="d3d66d47222dd8765a20a15fdc754c0ed7635404"
 Fixed #24940 -- Made model managers hashable

 Thanks Federico Jaramillo Martínez for the report and Tim Graham for the
 test and review.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:5>
Django <https://code.djangoproject.com/>
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.5242577c1d92e7263e78f4df8cd659f8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-18 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+-
 Reporter:  jmfederico   |Owner:  MarkusH
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   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 timgraham):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:4>
Django <https://code.djangoproject.com/>
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.b97fa28201ba72fb702614845b86cf9b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-18 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+
 Reporter:  jmfederico   |Owner:  MarkusH
 Type:  Bug  |   Status:  assigned
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   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 MarkusH):

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


Comment:

 PR: https://github.com/django/django/pull/4885

--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:3>
Django <https://code.djangoproject.com/>
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.71288add1e3ffae589e2a84bc8d846b9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-10 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+
 Reporter:  jmfederico   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   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 timgraham):

 * Attachment "24940-test.diff" added.


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


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-10 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
-+
 Reporter:  jmfederico   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.8
 Severity:  Release blocker  |   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 timgraham):

 * cc: MarkusH (added)
 * severity:  Normal => Release blocker
 * stage:  Unreviewed => Accepted


Comment:

 Bisected to aa5ef0d4fc67a95ac2a5103810d0c87d8c547bac. Attaching a
 regression test for Django's test suite.

--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:2>
Django <https://code.djangoproject.com/>
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.739ae5b6c0fb743b3c4390778e4dada6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-09 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
---+--
 Reporter:  jmfederico |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  contrib.admin  |  Version:  1.8
 Severity:  Normal |   Resolution:
 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 jmfederico):

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


Comment:

 A bit of debugging shows that when deleting an instance, django admin
 finds all the instances that are related to it in order to delete them as
 well.

 Problem is the dictionary created to store all the related instances to be
 deleted uses those same instances as keys in order to recursively find the
 whole tree.

 When GenericRelation has a related_query_name, it generates a dynamic
 "RelatedManager" class that is not hashable.

 This all happens in a NestedObjects class defined in
 django.contrib.admin.utils

 From there, I got lost.

--
Ticket URL: <https://code.djangoproject.com/ticket/24940#comment:1>
Django <https://code.djangoproject.com/>
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.4708d99ebb07f3a98413be49936ea72e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #24940: unhashable type: 'RelatedManager' when deleting a model using django admin that has GenericRelation and related_query_name

2015-06-05 Thread Django
#24940: unhashable type: 'RelatedManager' when deleting a model using django 
admin
that has GenericRelation and related_query_name
---+
 Reporter:  jmfederico |  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.8
 Severity:  Normal |   Keywords:
 Triage Stage:  Unreviewed |  Has patch:  0
Easy pickings:  0  |  UI/UX:  0
---+
 Ok, a few things before he report:
  - This is my first Django bug report (hope I do well)
  - Didn't know how else to call the report, a better summary is
 appreciated.

 The problem:
 When using django admin to delete an instance of a model that has a
 GenericRelation with a related_query_name, an "unhashable type:
 'RelatedManager'" error is thrown.

 If the related_query_name is removed, the error disappears.

 Example structure:

 {{{

 ...

 class ModelA(models.Model):

 """Model with GenericForeignKey."""

 content_type = models.ForeignKey(ContentType)
 object_id = models.PositiveIntegerField()
 content_object = GenericForeignKey()


 class ModelB(models.Model):

 """Model with a GenericRelation and related_query_name."""

 model_a = GenericRelation(ComponenteContable,
 related_query_name='model_a')


 class ModelC(models.Model):

 """Model with a GenericRelation and related_query_name."""

 model_c = GenericRelation(ComponenteContable,
 related_query_name='model_c')


 class ModelD(models.Model):

 """Model with a GenericRelation and related_query_name."""

 model_d = GenericRelation(ComponenteContable,
 related_query_name='model_d')

 ...

 }}}

 It is not possible to delete a model B, C or D instance in django admin if
 the have a related_query_name.

 The moment you remove related_query_name, that Model's instances can be
 deleted.

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