Skip to content

Commit

Permalink
Fixed #1218 -- Improved model validator to complain for non True/Fals…
Browse files Browse the repository at this point in the history
…e values for 'db_index' parameter

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
adrianholovaty committed Jan 15, 2006
1 parent 39639cf commit e260037
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions django/core/management.py
Expand Up @@ -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.' % f.name)
if f.db_index not in (None, True, False):
e.add(opts, '"%s" field: "db_index" should be either None, True or False.' % f.name)

# Check for multiple ManyToManyFields to the same object, and
# verify "singular" is set in that case.
Expand Down

0 comments on commit e260037

Please sign in to comment.