﻿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
6336	models.TextField gives an error on syncdb, if unique set to true	Shabda	nobody	"models.TextField is giving errors if unique=True
{{{
from django.db import models

class Category(models.Model):
    """"""Category under which a page is classified. ManyToMany relationship with pages.""""""
    text = models.TextField(max_length = 100, unique = True)
}}}
Get this model in models.py, and run syncdb. You will get an error like

{{{
Traceback (most recent call last):
  File ""F:\djangoprojects\testme\manage.py"", line 11, in ?
    execute_manager(settings)
  File ""C:\Python24\lib\site-packages\django\core\management\__init__.py"", line
272, in execute_manager
    utility.execute()
  File ""C:\Python24\lib\site-packages\django\core\management\__init__.py"", line
219, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""C:\Python24\lib\site-packages\django\core\management\base.py"", line 72,
in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""C:\Python24\lib\site-packages\django\core\management\base.py"", line 86,
in execute
    output = self.handle(*args, **options)
  File ""C:\Python24\lib\site-packages\django\core\management\base.py"", line 168,
 in handle
    return self.handle_noargs(**options)
  File ""C:\Python24\lib\site-packages\django\core\management\commands\syncdb.py""
, line 74, in handle_noargs
    cursor.execute(statement)
  File ""C:\Python24\lib\site-packages\django\db\backends\util.py"", line 18, in e
xecute
    return self.cursor.execute(sql, params)
  File ""C:\Python24\Lib\site-packages\MySQLdb\cursors.py"", line 166, in execute
    self.errorhandler(self, exc, value)
  File ""C:\Python24\Lib\site-packages\MySQLdb\connections.py"", line 35, in defau
lterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1170, ""BLOB/TEXT column 'text' used in key
specification without a key length"")
}}}
Change the type to SlugField or remove the unique and try syncdb, you will get no errors."		closed	Core (Other)	dev		duplicate	models	shabda.raaj@…	Unreviewed	0	0	0	0	0	0
