# Should child models inherit same fields as Parent model in Multi-table Inheritance?

**URL:** https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656
**Category:** Using Django
**Created:** [September 10, 2021, 4:06am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656 "2021-09-10T04:06:35Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![vicrost](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vicrost/32/4837_2.png) [@vicrost](https://forum.djangoproject.com/u/vicrost)
#### Post date: [September 10, 2021, 4:06am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/1 "2021-09-10T04:06:35Z")

</div>

Lets say I have two models connected with Multi-table Inheritance

```auto
class modelA(models.Model):
    name = models.CharField(blank=True,null=True,max_length=200)
    description = models.CharField(blank=True,null=True,max_length=200)

class modelB (modelA):
    friends = models.CharField(blank=True,null=True,max_length=200)
    favourite_food = models.CharField(blank=True,null=True,max_length=200)
 

```

When I try to add an object to modelB, I find that although the `name` and `description`  
fields from the parent model are listed, it’s blank so I have to set a new value to it. From my understanding of the [docs](https://docs.djangoproject.com/en/3.2/topics/db/models/#model-inheritance) on Multi-table Inheritance, I thought the child model will inherit all the fields of the parent’s model and so I only have to set the new fields defined in the child model when creating an object. Is this not the case?

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [September 10, 2021, 4:13am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/2 "2021-09-10T04:13:45Z")

</div>

The child models inherit the fields, not the values in the fields. Review the docs for more details and examples - [Models | Django documentation | Django](https://docs.djangoproject.com/en/3.2/topics/db/models/#multi-table-inheritance)

---

<div class="post-metadata">

### Author: ![vicrost](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vicrost/32/4837_2.png) [@vicrost](https://forum.djangoproject.com/u/vicrost)
#### Post date: [September 10, 2021, 4:16am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/3 "2021-09-10T04:16:30Z")

</div>

So is it possible to set the values in the fields as well so that essentially it’s a copy of the parent model but just with extra fields. I read the docs but I couldn’t find relating to that.

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [September 10, 2021, 4:20am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/4 "2021-09-10T04:20:10Z")

</div>

Immediately after the first example (using models named Place and Restaurant) at the provided link:

> All of the fields of `Place` will also be available in `Restaurant` , although the data will reside in a different database table.

Also, the opening paragraph identifies that multi-table inheritance is achieved by using a OneToOne relationship between the tables.

---

<div class="post-metadata">

### Author: ![vicrost](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vicrost/32/4837_2.png) [@vicrost](https://forum.djangoproject.com/u/vicrost)
#### Post date: [September 10, 2021, 4:38am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/5 "2021-09-10T04:38:35Z")

</div>

Okay, I understand that the data will be in a different table so MultiTableInheritance may not be what I want to use then.

so what model inheritance should I use if I want to create a child model that will inherit the fields and values of it’s parent? Then I would just add the new fields in the child model and those will be the only ones I enter when creating an object of the model.

Abstract base classes wouldn’t work as I still want a table for the Parent model and Proxy models are for methods , managers , etc.

---

<div class="post-metadata">

### Author: ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)
#### Post date: [September 10, 2021, 4:40am UTC](https://forum.djangoproject.com/t/should-child-models-inherit-same-fields-as-parent-model-in-multi-table-inheritance/9656/6 "2021-09-10T04:40:49Z")

</div>

That wouldn’t be model inheritance then. That’s just a Foreign Key relationship between two tables.

To clarify this a little bit. When you’re talking about model inheritance, you’re talking about a structural relationship between models. One model logically containing the same structure as another model. It’s not talking about the data within those models.

When you’re looking to establish relationships among the data within the models, that’s where the foreign key concept comes into play. It allows you to identify relationships between specific instances of models to specific instances of other models.
