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
This commit is contained in:
Adrian Holovaty 2005-08-15 04:44:19 +00:00
parent e004d2a0f7
commit 4a7159865e
1 changed files with 1 additions and 0 deletions

View File

@ -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