Serialization and multi-table inheritance
|Reported by:||issarisc@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The section on serializing models using multi-table inheritance is rather unhelpful IMHO. The solution the example suggests is of very limited use: They only show how to query all parent Model objects and all child Model objects and concatenate these lists.
In practice, I think it would be rather unlikely that anyone would want to use it like this, as the results of both queries are not connected in any way.
A more likely use-case would be if someone was querying the Restaurant Model, and would want to show the name of the restaurant for each of the results in the resulting QuerySet.
The documentation gives no solution or hint in the right direction regarding this, so I assume the only way would be to create a new list myself with the combined results and serializing that list.