On Sun, Feb 8, 2009 at 7:08 AM, Kless <[email protected]> wrote:
>
> Thanks Russel for your fast reply.
> My answer is down
>
> On 7 feb, 10:05, Russell Keith-Magee <[email protected]> wrote:
>> On Sat, Feb 7, 2009 at 6:03 PM, Kless <[email protected]> wrote:
>>
>> > Does anybody could help me with this?
>>
>> First off - please be patient. You've waited less than a day for a
>> response. Sometimes it will take a day or two to get a response -
>> especially when you ask your question on a Friday night.
> Yes, I'm sorry. But I saw that my message is already on the second
> page or so.

Second page of what? This is an email distributed mailing list. I get
close to 70 emails a day from Django-related mailing lists. If you're
talking about the web interface, then sure - messages will fall off
the "front page" pretty quickly. However, I suspect you'll find that
people using the web interface are in the minority. Everyone using a
mail client will have the message in their inbox until the read it.

>> As for your question - the text displayed by label_tag is derived from
>> the label on the field in your form definition. If you want the text
>> to read E-MAIL rather than e-mail, then modify the label property to
>> suit:
>>
>> http://docs.djangoproject.com/en/dev/ref/forms/fields/#django.forms.F...
> Yes, I supposed that. But the problem is when you want use a form of
> an external application, and you wann't write a custom form to change
> simply the case of any letters.
>
> This is the case of RegistrationForm in djago-registration [1], which
> has labes as lower case as *label=_(u'username')*

If you don't like the default form that has been provided by an
external application, then you have two options:

1) Write your own form.

2) Subclass the form, providing a replacement field definition for the
fields you want to modify. Any field definition in your form that has
the same name as a field on the base class will override the field
definition for the base class.

class MyRegistrationForm(RegistrationForm):
    username = forms.CharField(label='User Name')

However, if you want to modify every field, then you're essentially
back to option (1)

There are possibly a few other options that involve modifying the form
on a per instance basis - actually getting an instance of the form and
modifying the labels of each form in place, but they're not really
well advised - they could lead to some code fragility. If you're
particularly keen, have a play with a form instance - you should be
able to work out what to do.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to