django verbose_name limitation
October 2021
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
About
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
Categories
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (22 items)
Zope (13 items)
Daily (144 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (10 items)
Networking (1 items)
DNS (0 items)
Archives

Syndicate this site (XML)

RSS/RDF 0.91

27 noviembre
2008

django verbose_name limitation

Learning new things every day

This is one of those things you never know about until it happens to you.

Some days ago, while working on a django project, I made some changes to an app models. Since I was at the beginning stages of the development process, I just droped the database, created it again and I used syncdb to recreate the whole thing (yes, I used syncdb because I didn't use nor django-evolution neither south or any other migrations tool).

It seemed to be working properly:

snowball:Zero14 wu$ python manage.py syncdb
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message

But after created the default user to access the admin interface, I got this error:

psycopg2.ProgrammingError: value too long for type character varying(50)

(full trace here).

It seems like something (probably in models.py) was wrong. I revised my models file, nothing about a field limited to 50 characters... strange.

As usual, I asked in #django (on freenode) and, as usual, Magus- pointed me in the right direction, asking me if I had any model with a name longer than 50 characters. Of course I do not have any model with such a long name, but searching a little bit deeper, I found that one of the models had a verbose_name had a 80-character long string associated.

Replacing that with a more appropiate string (below 50 characters) fixed the problem.

Posted by wu at 10:19 | Comments (0) | Trackbacks (0)
<< self() 2.9 released | Main | STOP >>
Comments
There are no comments.
Trackbacks
Please send trackback to:http://blog.e-shell.org/126/tbping
There are no trackbacks.
Post a comment