On Fri, Jul 3, 2009 at 6:06 AM, TechnicalBard<[email protected]> wrote: > > To clarify, the djangobook states: > > << On the admin site’s edit forms, each field’s label is generated > from its model field name. The algorithm is simple: Django just > replaces underscores with spaces and capitalizes the first character, > so, for example, the Book model’s publication_date field has the label > “Publication date.” >> > > Where in the django.contrib.admin code is this logic found? I would > like to utilize it.
This is part of the forms library - django.forms.forms.pretty_name [1] is used [2] to generate a label from the field name if a label was not given when the field was instantiated. Jonathan. [1] http://code.djangoproject.com/browser/django/trunk/django/forms/forms.py#L20 [2] http://code.djangoproject.com/browser/django/trunk/django/forms/forms.py#L346 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

