From 4a7159865e766cf586ada6f3f73fb5f7504354b8 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Mon, 15 Aug 2005 04:44:19 +0000 Subject: [PATCH] Improved error handling for invalid model parameters that aren't custom functions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@502 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/meta/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 554ba4eda0b..69f6538a4c6 100644 --- a/django/core/meta/__init__.py +++ b/django/core/meta/__init__.py @@ -464,6 +464,7 @@ class ModelBase(type): for k, v in attrs.items(): if k in ('__module__', '__init__', '_overrides', '__doc__'): continue # Skip the important stuff. + assert callable(v), "%r is an invalid model parameter." % k # Give the function a function attribute "custom" to designate that # it's a custom function/method. v.custom = True