diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-08-15 04:44:19 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-08-15 04:44:19 +0000 |
| commit | 4a7159865e766cf586ada6f3f73fb5f7504354b8 (patch) | |
| tree | 6c34380c78e25a31e7a720df05bee03febadf109 | |
| parent | e004d2a0f78d4a09f32586b6d15028fc5957cd13 (diff) | |
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
| -rw-r--r-- | django/core/meta/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/django/core/meta/__init__.py b/django/core/meta/__init__.py index 554ba4eda0..69f6538a4c 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 |
