@@ -0,0 +1,970 @@
+%22%22%22Example of using polymorphic inheritance features to keep multiple related%0Amodels in a single collection%22%22%22%0A%0Aimport uuid%0A%0Afrom modularodm import InheritableStoredObject, fields%0Afrom modularodm.storage import EphemeralStorage%0A%0A%0Aclass Car(InheritableStoredObject):%0A    _id = fields.StringField(primary=True, default=uuid.uuid4)%0A%0A    brand = None%0A%0A    doors = None%0A%0A%0Aclass Ford(Car):%0A    brand = %22Ford%22%0A%0A%0Aclass FordFocus(Ford):%0A    doors = 4%0A%0A%0Astorage = EphemeralStorage()%0Afor cls in (Car, Ford, FordFocus):%0A    cls.set_storage(storage)%0A%0A%0Ageneric_car = Car()%0Ageneric_car.save()%0A%0Ageneric_ford = Ford()%0Ageneric_ford.save()%0A%0Aford_focus = FordFocus()%0Aford_focus.save()%0A%0A%0A# All three cars have been saved%0Aassert Car.find().count() == 3%0A%0A# Only two of the cars were Fords%0Aassert Ford.find().count() == 2%0A%0A# Only one was a Focus%0Aassert FordFocus.find().count() == 1%0A%0A# Each item returned is an instance of its most specific type%0Afor car in Car.find():%0A    print(car.__class__)%0A

Add example for polymorphic inheritance