﻿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
18866	model Meta verbose_name too long error message not obvious	Elena Williams	toyg	"Running:

{{{$ python manage.py syncdb}}}

The following error messages:

Postgres:
{{{
Creating tables ...
Traceback (most recent call last):
  File ""manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/Library/Python/2.7/site-packages/django/core/management/__init__.py"", line 443, in execute_from_command_line
    utility.execute()
  File ""/Library/Python/2.7/site-packages/django/core/management/__init__.py"", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/Library/Python/2.7/site-packages/django/core/management/base.py"", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Library/Python/2.7/site-packages/django/core/management/base.py"", line 232, in execute
    output = self.handle(*args, **options)
  File ""/Library/Python/2.7/site-packages/django/core/management/base.py"", line 371, in handle
    return self.handle_noargs(**options)
  File ""/Library/Python/2.7/site-packages/django/core/management/commands/syncdb.py"", line 110, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File ""/Library/Python/2.7/site-packages/django/core/management/sql.py"", line 189, in emit_post_sync_signal
    interactive=interactive, db=db)
  File ""/Library/Python/2.7/site-packages/django/dispatch/dispatcher.py"", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File ""/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py"", line 54, in create_permissions
    auth_app.Permission.objects.bulk_create(objs)
  File ""/Library/Python/2.7/site-packages/django/db/models/manager.py"", line 140, in bulk_create
    return self.get_query_set().bulk_create(*args, **kwargs)
  File ""/Library/Python/2.7/site-packages/django/db/models/query.py"", line 416, in bulk_create
    self.model._base_manager._insert(objs_without_pk, fields=[f for f in fields if not isinstance(f, AutoField)], using=self.db)
  File ""/Library/Python/2.7/site-packages/django/db/models/manager.py"", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File ""/Library/Python/2.7/site-packages/django/db/models/query.py"", line 1576, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File ""/Library/Python/2.7/site-packages/django/db/models/sql/compiler.py"", line 910, in execute_sql
    cursor.execute(sql, params)
  File ""/Library/Python/2.7/site-packages/django/db/backends/util.py"", line 40, in execute
    return self.cursor.execute(sql, params)
  File ""/Library/Python/2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py"", line 52, in execute
    return self.cursor.execute(query, args)
django.db.utils.DatabaseError: value too long for type character varying(50)
}}}

MySQL:
{{{
Creating tables ...
Traceback (most recent call last):
  File ""manage.py"", line 10, in <module>
    execute_from_command_line(sys.argv)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/__init__.py"", line 443, in execute_from_command_line
    utility.execute()
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/__init__.py"", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/base.py"", line 196, in run_from_argv
    self.execute(*args, **options.__dict__)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/base.py"", line 232, in execute
    output = self.handle(*args, **options)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/base.py"", line 371, in handle
    return self.handle_noargs(**options)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/commands/syncdb.py"", line 110, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive, db)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/core/management/sql.py"", line 189, in emit_post_sync_signal
    interactive=interactive, db=db)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/dispatch/dispatcher.py"", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py"", line 54, in create_permissions
    auth_app.Permission.objects.bulk_create(objs)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/models/manager.py"", line 140, in bulk_create
    return self.get_query_set().bulk_create(*args, **kwargs)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/models/query.py"", line 416, in bulk_create
    self.model._base_manager._insert(objs_without_pk, fields=[f for f in fields if not isinstance(f, AutoField)], using=self.db)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/models/manager.py"", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/models/query.py"", line 1576, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/models/sql/compiler.py"", line 910, in execute_sql
    cursor.execute(sql, params)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/backends/util.py"", line 40, in execute
    return self.cursor.execute(sql, params)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/django/db/backends/mysql/base.py"", line 114, in execute
    return self.cursor.execute(query, args)
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/MySQLdb/cursors.py"", line 176, in execute
    if not self._defer_warnings: self._warning_check()
  File ""/Users/elena/.virtualenvs/wc/lib/python2.7/site-packages/MySQLdb/cursors.py"", line 92, in _warning_check
    warn(w[-1], self.Warning, 3)
_mysql_exceptions.Warning: Data truncated for column 'name' at row 13
}}}

What is this error?

It is caused by {{{contenttypes.name}}}, see SO:
http://stackoverflow.com/questions/10855978/heroku-and-django-value-too-long-for-type-character-varying50

Easily replicated:

{{{
class MyModel(models.Model):
    class Meta:
        verbose_name = ""soem ridiculously long verbose name that is out of control""
}}}

This is not serious. It's just not obvious."	Bug	closed	contrib.auth	1.4	Normal	fixed		kerry@…	Accepted	1	0	1	0	0	0
