Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 4a7159865e766cf586ada6f3f73fb5f7504354b8 1 parent e004d2a
@adrianholovaty adrianholovaty authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.