Ticket #8777: validate-unique-capfirst.diff

File validate-unique-capfirst.diff, 940 bytes (added by Petr Marhoun <petr.marhoun@…>, 16 years ago)
  • django/forms/models.py

    === modified file 'django/forms/models.py'
     
    55
    66from django.utils.encoding import smart_unicode
    77from django.utils.datastructures import SortedDict
    8 from django.utils.text import get_text_list
     8from django.utils.text import get_text_list, capfirst
    99from django.utils.translation import ugettext_lazy as _
    1010
    1111from util import ValidationError, ErrorList
     
    247247            # This cute trick with extra/values is the most efficiant way to
    248248            # tell if a particular query returns any results.
    249249            if qs.extra(select={'a': 1}).values('a').order_by():
    250                 model_name = self.instance._meta.verbose_name.title()
     250                model_name = capfirst(self.instance._meta.verbose_name)
    251251               
    252252                # A unique field
    253253                if len(unique_check) == 1:
Back to Top