Newforms: verbose_name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Newforms: verbose_name

SmileyChris

It would be nice to have a verbose_name option for fields in newforms
for when you want an alternate to the magical pretty_name. I've been
trying to think about where best to put a it.

The end goal is that BoundFields have verbose_name property which can
return the verbose name or fall back to the pretty_name function.

Currently, Fields are decoupled from their name, so would it be wrong
to attach it like this?
...     agent_phone = DateField(verbose_name="Agent's phone number")


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Newforms: verbose_name

Adrian Holovaty-3

On 11/16/06, SmileyChris <[hidden email]> wrote:

> It would be nice to have a verbose_name option for fields in newforms
> for when you want an alternate to the magical pretty_name. I've been
> trying to think about where best to put a it.
>
> The end goal is that BoundFields have verbose_name property which can
> return the verbose name or fall back to the pretty_name function.
>
> Currently, Fields are decoupled from their name, so would it be wrong
> to attach it like this?
> ...     agent_phone = DateField(verbose_name="Agent's phone number")

I've been thinking about this one as well... The framework certainly
needs to support verbose_names for fields, but the question is where
to specify it. Adding a verbose_name in Field is probably the best
place -- or, rather, least ugly place.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Newforms: verbose_name

Karsu

That verbose_name attribute is very important if we think about
Internationalization.

Something like this:
agent_phone = DateField(verbose_name=_("Agent's phone number"))


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: Newforms: verbose_name

Adrian Holovaty-3

On 11/30/06, Karsu <[hidden email]> wrote:
> That verbose_name attribute is very important if we think about
> Internationalization.
>
> Something like this:
> agent_phone = DateField(verbose_name=_("Agent's phone number"))

For the record, newforms Field objects have a "label" hook now.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---