class name length limitation

6 views
Skip to first unread message

Jan Ostrochovsky

unread,
Sep 9, 2009, 5:31:20 PM9/9/09
to Django Evolution
Hello,

I haven't found this in documentation, but I found limitation of
length of class name, after which evolution failed.

up to 34 characters - OK
35 characters - failed

ostry@mirka-markiza:~/Dropbox/My Documents/Business/DSBIS$ python
manage.py syncdb
Creating table core_businessunitregistrationidentifier
Creating table core_businessunittaxidentifier
Creating table core_businessunitvalueaddedtaxidentifier
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 362, in execute_manager
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 303, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 195, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 222, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 351, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
commands/syncdb.py", line 99, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
sql.py", line 205, in emit_post_sync_signal
interactive=interactive)
File "/usr/local/lib/python2.6/dist-packages/django/dispatch/
dispatcher.py", line 166, in send
response = receiver(signal=self, sender=sender, **named)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/auth/
management/__init__.py", line 28, in create_permissions
defaults={'name': name, 'content_type': ctype})
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
manager.py", line 123, in get_or_create
return self.get_query_set().get_or_create(**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 335, in get_or_create
obj.save(force_insert=True)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
base.py", line 410, in save
self.save_base(force_insert=force_insert,
force_update=force_update)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
base.py", line 495, in save_base
result = manager._insert(values, return_id=update_pk)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
manager.py", line 177, in _insert
return insert_query(self.model, values, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 1087, in insert_query
return query.execute_sql(return_id)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
subqueries.py", line 320, in execute_sql
cursor = super(InsertQuery, self).execute_sql(None)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
query.py", line 2369, in execute_sql
cursor.execute(sql, params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
util.py", line 19, in execute
return self.cursor.execute(sql, params)
psycopg2.DataError: value too long for type character varying(50)

I don't know, if this is wished state, or not, so I haven't posted it
as issue, but as discussion topic.

Jano

Jan Ostrochovsky

unread,
Sep 9, 2009, 5:36:01 PM9/9/09
to Django Evolution
Update: Probably more acccurate values are not 34/35, but 39/40,
probably is important also app name length plus one character for
underscore. What are rest of 50 characters from error message
psycopg2.DataError: value too long for type character varying(50), I
don't know.

On Sep 9, 11:31 pm, Jan Ostrochovsky <jan.ostrochov...@gmail.com>
wrote:

Russell Keith-Magee

unread,
Sep 11, 2009, 6:06:04 PM9/11/09
to django-e...@googlegroups.com
On Thu, Sep 10, 2009 at 5:36 AM, Jan Ostrochovsky
<jan.ostr...@gmail.com> wrote:
>
> Update: Probably more acccurate values are not 34/35, but 39/40,
> probably is important also app name length plus one character for
> underscore. What are rest of 50 characters from error message
> psycopg2.DataError: value too long for type character varying(50), I
> don't know.

It's not specifically a limitation of Django Evolution; it's a
limitation of the permissions framework of Django itself. It isn't
specifically documented, but there is a Django ticket logged that
describes the problem:

http://code.djangoproject.com/ticket/8548

Yours,
Russ Magee %-)
Reply all
Reply to author
Forward
0 new messages