﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30095	System check error for tuples or lists in model field choices.	Pedro Marcondes	Hasan Ramezani	"Since version 2.1 django stopped to accept tuples as value in choices.

I'll give you an example using the User model so you can reproduce. The error occurs when I do manage.py runserver.

I tried to find in the release notes from django 2.1.* versions but couldn't find something adressing this change. This model works with django version 2.0.10 and below.

  {{{#!python
from __future__ import unicode_literals
from django.db import models
from django.contrib.postgres.fields import IntegerRangeField


class Article(models.Model):

    LTE_50 = (1, 50)
    LTE_100 = (51, 100)

    SIZE_CHOICES = (
        (LTE_50, ""1-50""),
        (LTE_100, ""51-100""),
    )
  
    article_size = IntegerRangeField(choices=SIZE_CHOICES)
   """"""
   django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

   ERRORS:
   article.Article.article_size: (fields.E005) 'choices' must be an iterable containing (actual value, human readable name) tuples.
   """"""

    published = models.BooleanField(""Is published"", default=False)

    class Meta:
        verbose_name = ""Article""
        verbose_name_plural = ""Articles""

    def __str__(self):
        return ""test""

  }}}
"	Bug	closed	Database layer (models, ORM)	dev	Normal	fixed	choices tuple		Accepted	1	0	0	0	0	0
