Browse files

Fixed #1218 -- Improved model validator to complain for non True/Fal…

…se values for 'db_index' parameter

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
adrianholovaty committed Jan 15, 2006
1 parent 39639cf commit e260037e168152b17e4f46685ccce301fe3f5c99
Showing with 2 additions and 0 deletions.
  1. +2 −0 django/core/
@@ -664,6 +664,8 @@ def get_validation_errors(outfile):
for c in f.choices:
if not type(c) in (tuple, list) or len(c) != 2:
e.add(opts, '"%s" field: "choices" should be a sequence of two-tuples.' %
+ if f.db_index not in (None, True, False):
+ e.add(opts, '"%s" field: "db_index" should be either None, True or False.' %
# Check for multiple ManyToManyFields to the same object, and
# verify "singular" is set in that case.

0 comments on commit e260037

Please sign in to comment.