I've changed the model form, but don't work...

class GameForm(ModelForm):
    class Meta:
        model = Game
        time_days_W = forms.CharField(max_length=128, verbose_name="time")
        fields = ('white', 'black', 'time_days_W', 'inc_time')


I've this error:

TypeError: __init__() got an unexpected keyword argument 'verbose_name'
failed!


Regards,

Alfredo



2008/10/10 Adrian-Bogdan Andreias <[EMAIL PROTECTED]>:
> You can customize the form template and render each field separately or
> define the label in your model, using verbose_name parameter:
>
> class Game(Model):
>     # ...
>     time_days_W = CharField(max_length=128, verbose_name="time")
>
> 2008/10/10 Alfredo Alessandrini <[EMAIL PROTECTED]>
>>
>> Hi,
>>
>> I've create a model form by:
>>
>> class GameForm(ModelForm):
>>    class Meta:
>>        model = Game
>>        fields = ('white', 'black', 'time_days_W', 'inc_time')
>>
>>
>> and the form template:
>>
>> <form action="/setup_game/" method="POST">
>> {{ form.as_p }}
>> <input type="submit" value="Submit" />
>>
>>
>> The view function is ok, but I want to change the label of a field.
>>
>> I want to change "time_days_W" with "time".
>>
>> I must customizing the form template for this?
>>
>>
>> Alfredo
>>
>>
>
>
>
> --
> http://jquerybox.com - jQuery forum
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to