#29691: Support ForeignKey based model inheritance
-------------------------------------+-------------------------------------
               Reporter:  James Pic  |          Owner:  nobody
                   Type:  New        |         Status:  new
  feature                            |
              Component:  Database   |        Version:  2.1
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Currently, a model inheriting another will have a 1:1 relation with an
 automatically managed OneToOneField. This means a parent model instance
 may only have one child model instance. However, sometimes it may be
 interresting to have several child model instances for one parent model
 instance.

 For example, creating a new child model with the same parent results in an
 error like:

        django.db.utils.IntegrityError: UNIQUE constraint failed:
 djcall_call.callable_ptr_id

 But overriding the parent field with a ForeignKey is not accepted:

       django.core.exceptions.FieldError: Auto-generated field
 'callable_ptr' in class 'Call' for parent_link to base class 'Callable'
 clashes with declared field of the same name.

 Can we perhaps add an exception (not Exception!) for child models that
 override the automatic ptr field that is a OneToOneField, with a
 ForeignKey ?

 Thanks

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29691>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.9c9d4c06d97d3a14c53859719faf1b56%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to