Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Adrian Holovaty authored August 15, 2005

Showing 1 changed file with 1 addition and 0 deletions. Show diff stats Hide diff stats

  1. 1  django/core/meta/__init__.py
1  django/core/meta/__init__.py
@@ -464,6 +464,7 @@ def __new__(cls, name, bases, attrs):
464 464
         for k, v in attrs.items():
465 465
             if k in ('__module__', '__init__', '_overrides', '__doc__'):
466 466
                 continue # Skip the important stuff.
  467
+            assert callable(v), "%r is an invalid model parameter." % k
467 468
             # Give the function a function attribute "custom" to designate that
468 469
             # it's a custom function/method.
469 470
             v.custom = True

0 notes on commit 4a71598

Please sign in to comment.
Something went wrong with that request. Please try again.