On 3/21/06, ChaosKCW <[EMAIL PROTECTED]> wrote: > I am wondering what I need to do in order to get the admin site to > enforce the maxlength property. I am using the MR Branch. > > I have a model with a CharField where maxlength=3. I goto in admin. It > shows a huge box ie way more than 3 charcaaters, allows you to enter > more than 3 characters and doesnt error when you save more than 3 > characters. > > This seems strange to me. Any suggestions ?
Hi Chaos, CharFields are represented in the admin with a fixed length. The "maxlength" property on those boxes is set correctly, but the size of the actual form element is hard-coded. This is probably worth changing, because you're right to note that it's silly for a two-character field to have a long input element. But we can't just blindly set the length of the field to the maxlength, because maxlength=200 would result in a horribly long field. There would have to be some sort of upper limit. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---