dominno / django-moderation

django-moderation is reusable application for Django framework, that allows to moderate any model objects.
BSD 3-Clause "New" or "Revised" License
269 stars 91 forks source link

Support for models with non-abstract inheritance #33

Closed treyhunner closed 13 years ago

treyhunner commented 13 years ago

These changes add multi-table inheritance support. Before this change, fields in non-abstract parent models would never be serialized so deserialization would create a broken model instance with missing data.

This change removes support for multi-object serialization from SerializedObjectField in order to support the storage of parent models after the child model in a serialized list.

This change only supports single parent inheritance to one level deep. Multiple parent inheritance is unusual in Django in that it adds another field to the model and I assume this is used very infrequently. Multiple level inheritance (A is a child to B is a child to C) adds parents to direct child models only so my current method of adding direct parents to an array does not work.

I am open to suggestions for changes in the method of serialization since the current method only works for single parents.

dominno commented 13 years ago

I have merged your change. Thank you.