djangosnippets.org: Latest snippets tagged with 'child-model'https://djangosnippets.org/tags/child-model/2010-07-03T11:31:41.335148-05:00Get actual child model in multi-table inheritance
2010-07-03T11:31:41.335148-05:00brongerhttps://djangosnippets.org/snippets/2091/<p>A common problem (it hit the Django mailinglist a couple of times) is that if you get <code>models.Topping.objects.all()</code>, you get a list of toppings, although they stand for other classes such as <code>SalamiTopping</code> or <code>CheeseTopping</code>. If you need the actual object, just derive <code>Topping</code> from <code>PolymorphicModel</code>, and …</p>
Freely redistributable