app/polymodel/__init__.py
changeset 204 7075c27170f2
parent 203 187d45783300
equal deleted inserted replaced
203:187d45783300 204:7075c27170f2
    10 
    10 
    11 from google.appengine.ext import db
    11 from google.appengine.ext import db
    12 
    12 
    13 import sys
    13 import sys
    14 
    14 
       
    15 # Add ModelWithFieldAttributes *before* PolyModel, so that everything does
       
    16 # not become a "ModelWithFieldAttributes" in the Datastore.
       
    17 from soc.models import base
       
    18 
    15 class Error(Exception):
    19 class Error(Exception):
    16     """Base of all exceptions in the blixt.data module."""
    20     """Base of all exceptions in the blixt.data module."""
    17     pass
    21     pass
    18 
    22 
    19 class PolyModel(db.Model):
    23 class PolyModel(base.ModelWithFieldAttributes):
    20     """An extension to Google App Engine models that improves the support for
    24     """An extension to Google App Engine models that improves the support for
    21     inheritance.
    25     inheritance.
    22 
    26 
    23     Any models extending a model that extends PolyModel will be stored in the
    27     Any models extending a model that extends PolyModel will be stored in the
    24     datastore as the same kind as the model that extends PolyModel, but with
    28     datastore as the same kind as the model that extends PolyModel, but with