Changes between Initial Version and Version 1 of Ticket #8548


Ignore:
Timestamp:
Aug 25, 2008, 7:16:46 PM (16 years ago)
Author:
Malcolm Tredinnick
Comment:

(Fixed description. The preview button is your friend.)

This problem should be caught by the validate command for django-admin.py. That's the most logical fix.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8548

    • Property Component Database wrapperdjango-admin.py
    • Property Milestonepost-1.0
    • Property Triage Stage UnreviewedAccepted
  • Ticket #8548 – Description

    initial v1  
     1{{{
     2#!python
    13class Thingie(models.Model)
    24#fields go here
    35  class Meta:
    46    verbose_name = 'A String Greater Than 50 Characters Long, Probably For The Admin'
     7}}}
    58
    69Running 'python manage.py syncdb' results in MySQLdb trying to run the following:
    7 
     10{{{
     11#!sql
    812INSERT INTO `auth_permission` (`name`, `content_type_id`, `codename`) VALUES (%s, %s, %s)(u'A String Greater Than 50 Characters Long, Probably For The Admin', 11, u'add_thingie')
     13}}}
    914
    1015The field `name` has a length restriction of 50 characters.  This results in a warning 'error' being generated (_mysql_exceptions.Warning: Data truncated for column 'name' at row 1) but no further useful information.  This also halts syncdb, which is also called during the test suite.
    1116
    1217Suggestions (since I'm nowhere near qualified to contribute, yet):
    13 - Maybe just catch the warning and ignore it?  This seems to be a display-only field, so it probably won't hurt.
    14 - Or maybe catch the warning and explain the cause?
    15 - Model validator could complain about verbose_name being too long?
    16 - Increase the size of the field?
    17 - Maybe just let google index this ticket so that the next person to google the error sees why it happened?
     18 - Maybe just catch the warning and ignore it?  This seems to be a display-only field, so it probably won't hurt.
     19 - Or maybe catch the warning and explain the cause?
     20 - Model validator could complain about verbose_name being too long?
     21 - Increase the size of the field?
     22 - Maybe just let google index this ticket so that the next person to google the error sees why it happened?
    1823
     24{{{
    1925Traceback (most recent call last):
    2026  File "manage.py", line 11, in <module>
     
    6369    raise message
    6470_mysql_exceptions.Warning: Data truncated for column 'name' at row 1
     71}}}
Back to Top