#18061: GenericRelation doesn't play well with proxy models
-------------------------------+--------------------
     Reporter:  anonymous      |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.4
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 Take the following models:



 {{{
 class Person(models.Model):
     """
     Teenager (let's say this has the content type ID 1)
     """
     age = models.IntegerField()


 class Teenager(Person):
     """
     Teenager (let's say this has the content type ID 2)
     """
     class Meta:
         proxy = True


 class Pimple(models.Model):
     """
     A pimple.
     """
     content_type = models.ForeignKey(ContentType)
     object_id = models.IntegerField()
     content_object = generic.GenericForeignKey('content_type',
 'object_id')
     color = models.CharField()
 }}}


 Now, if I create a {{{PimpleInline}}} on the {{{TeenagerAdmin}}}, and then
 create {{{Pimple}}} records with the main {{{PimpleAdmin}}}, setting the
 content type to {{{Teenager (ie, 2)}}}, you would think that a refresh on
 the {{{TeenagerAdmin}}} would reveal my new pimple in the inline list, but
 it doesn't. This has to do with the {{{GenericRelation.contrib_to_class}}}
 which attaches an updated queryset along the way, filtering by the content
 type of the proxy's parent model.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18061>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to