Andrew Godwin committed b881df2

Fix #155: Proxy model support

Comments (0)

Files changed (2)


             new = dict([
                 (model_key(model), prep_for_freeze(model))
                 for model in models.get_models(app_models_module)
+                if not getattr(model._meta, "proxy", False)
             # And filter other apps out of the old
             old = dict([


             raise IsDefault
     # Models get their own special repr()
     if isinstance(value, ModelBase):
+        # If it's a proxy model, follow it back to its non-proxy parent
+        if getattr(value._meta, "proxy", False):
+            value = value._meta.proxy_for_model
         return "orm['%s.%s']" % (value._meta.app_label, value._meta.object_name)
     # Callables get called.
     elif callable(value):