#16913: Admin error when trying to delete object with a GenericRelation
------------------------------------+-------------------------------
               Reporter:  r1cky     |          Owner:  carljm
                   Type:  Bug       |         Status:  assigned
              Milestone:            |      Component:  contrib.admin
                Version:  1.3       |       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         |
------------------------------------+-------------------------------

Comment (by r1cky):

 The reason I needed related_name is that, in my case (1), the
 GenericRelation is actually in an abstract base class and we inherit from
 it into two models with the same name in separate apps. If I don't set it,
 I get an error about collisions during model validation when starting the
 dev server:
 {{{
 forums.thread: Accessor for m2m field 'watches' clashes with related m2m
 field 'Watch.thread_set'. Add a related_name argument to the definition
 for 'watches'.
 kbforums.thread: Accessor for m2m field 'watches' clashes with related m2m
 field 'Watch.thread_set'. Add a related_name argument to the definition
 for 'watches'.
 }}}

 We have a model named Thread in two different apps. I guess that is a
 different bug? The validation of models probably shouldn't complain in
 this case.

 (1) https://github.com/erikrose/django-
 tidings/blob/master/tidings/models.py#L118

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16913#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 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.

Reply via email to