Add ModelWithFieldAttributes *before* PolyModel, so that everything does not
become a "ModelWithFieldAttributes" in the Datastore.
The way PolyModel works, each Model class hierarchy is stored in the Datastore
as the class that directly inherited from PolyModel. So, we do not want to
insert ModelWithFieldAttributes *after* PolyModel by inheriting *from*
PolyModel, or everything would just be a ModelWithFieldAttributes in the
Datastore, instead of Person, Work, Group, etc.
--- a/app/polymodel/__init__.py Fri Sep 26 19:35:21 2008 +0000
+++ b/app/polymodel/__init__.py Fri Sep 26 19:47:07 2008 +0000
@@ -12,11 +12,15 @@
import sys
+# Add ModelWithFieldAttributes *before* PolyModel, so that everything does
+# not become a "ModelWithFieldAttributes" in the Datastore.
+from soc.models import base
+
class Error(Exception):
"""Base of all exceptions in the blixt.data module."""
pass
-class PolyModel(db.Model):
+class PolyModel(base.ModelWithFieldAttributes):
"""An extension to Google App Engine models that improves the support for
inheritance.