Browse files

Improved error handling for invalid model parameters that aren't cust…

…om functions.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent e004d2a commit 4a7159865e766cf586ada6f3f73fb5f7504354b8 @adrianholovaty adrianholovaty committed Aug 15, 2005
Showing with 1 addition and 0 deletions.
  1. +1 −0 django/core/meta/__init__.py
View
1 django/core/meta/__init__.py
@@ -464,6 +464,7 @@ def __new__(cls, name, bases, attrs):
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

0 comments on commit 4a71598

Please sign in to comment.