#28332: Diamond multiple inheritance example in docs gives a clashing field check error -------------------------------------+------------------------------------- Reporter: Luc Saffre | Owner: Jeremy | Satterfield Type: Bug | Status: assigned Component: Documentation | Version: 1.11 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 Jeremy Satterfield):
* owner: nobody => Jeremy Satterfield * status: new => assigned * has_patch: 0 => 1 Comment: The `PizzeriaBar` model is inheriting the `restaurant_ptr` field from both `Pizzeria` and `Bar`, so you need to specify the parent link field on at least one of them, per https://docs.djangoproject.com/en/dev/topics/db/models/#specifying-the- parent-link-field. This gets a little complicated if you are creating this child model and overriding these field names at a later date than the parent since you are changing the field name, it is going to require using the `db_column` arg on the field or more complex migrations. This seems to me to have a lot of caveats to be provided as an example in the docs; however, here is a PR that updates the existing example to be working. -- Ticket URL: <https://code.djangoproject.com/ticket/28332#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/065.6ee60cdc8740484da61412f7515717ca%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.