Re: [Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-06-12 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  model proxy multi-   |  Needs documentation:  0
  table inheritance signals  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by jdunck):

 * keywords:  model proxy multi-table inheritance => model proxy multi-table
 inheritance signals


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-04-10 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  model proxy multi-   |  Needs documentation:  0
  table inheritance  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by charettes):

 The signal issue ticket is #18094.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-04-09 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:  fixed
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  model proxy multi-   |  Needs documentation:  0
  table inheritance  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by carljm):

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


Comment:

 In [17887]:
 {{{
 #!CommitTicketReference repository="" revision="17887"
 Fixed #18083 -- Fixed cascade deletion with proxy model of concrete
 subclass. Thanks Simon Charette for report and 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-04-09 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  model proxy multi-   |  Needs documentation:  0
  table inheritance  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by charettes):

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


Comment:

 Attached a patch that fixes the issue but change the way `pre_delete` and
 `post_delete` signals are sent.

 Before patch only the `ConcreteModelSubclassProxy`'s signals we're sent
 which was definitely buggy.

 When the patch is applied `ConcreteModelSubclassProxy`'s and then
 `ConcreteModel`'s signals are sent which is still buggy but better IMHO.

 In this particular case I beleive signals for the three classes should be
 triggered in this order: `ConcreteModelSubclassProxy` then
 `ConcreteModelSubclass` and finally `ConcreteModel`. But that’s another
 story, as suggested by @carljm I'll open a new ticket that depends on this
 one and attempt to fix the signal issue there.

 I'm also exceptionally marking as ''Accepted'' my own bug because I had
 agreement it's a valid bug on IRC.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-04-09 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|Owner:  charettes
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.4
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:  model proxy multi-   |  Unreviewed
  table inheritance  |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by charettes):

 * owner:  nobody => charettes
 * 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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #18083: Multi-table inheritance subclasses proxy deletion is broken

2012-04-07 Thread Django
#18083: Multi-table inheritance subclasses proxy deletion is broken
-+-
 Reporter:  charettes|  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Database layer   |Version:  1.4
  (models, ORM)  |   Keywords:  model proxy multi-table
 Severity:  Normal   |  inheritance
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+-
 Given the following models

 {{{#!python
 #test_app/models.py
 from django.db import models

 class A(models.Model):
 pass

 class B(A):
 pass

 class C(B):
 class Meta:
 proxy = True
 }}}

 Running the following tests fails

 {{{#!python
 #test_app/tests.py
 from django.test import TestCase

 from .models import *


 class SimpleTest(TestCase):

 def test_model_subclass_proxy_deletion(self):
 c = C.objects.create()
 self.assertEqual(1, C.objects.count())
 self.assertEqual(1, B.objects.count())
 self.assertEqual(1, A.objects.count())

 c.delete()
 self.assertEqual(0, C.objects.count())
 self.assertEqual(0, B.objects.count())
 self.assertEqual(0, A.objects.count())

 def test_model_subclass_deletion(self):
 b = B.objects.create()
 self.assertEqual(1, C.objects.count())
 self.assertEqual(1, B.objects.count())
 self.assertEqual(1, A.objects.count())

 b.delete()
 self.assertEqual(0, C.objects.count())
 self.assertEqual(0, B.objects.count())
 self.assertEqual(0, A.objects.count())
 }}}

 {{{
 simon@simon-laptop:~/Bureau/test_deletion$ ./manage.py test test_app
 Creating test database for alias 'default'...
 .F
 ==
 FAIL: test_model_subclass_proxy_deletion (test_app.tests.SimpleTest)
 --
 Traceback (most recent call last):
   File "/home/simon/Bureau/test_deletion/test_app/tests.py", line 27, in
 test_model_subclass_proxy_deletion
 self.assertEqual(0, A.objects.count())
 AssertionError: 0 != 1

 --
 Ran 2 tests in 0.014s

 FAILED (failures=1)
 Destroying test database for alias 'default'...
 }}}

 Deleting a multi-table inherited model proxy do not delete all related
 parent instances while doing it on the concrete model works perfectly.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.