But if you subclass the widget, then you'll need to override every
form's widget with
{
forms.DateField: MyDateWidget
}
so overriding and using your own MyDateField would be less verbose and
repetitive
On Sat, Aug 4, 2012 at 6:17 PM, Melvyn Sopacua wrote:
> On 3-8-2012 18:23, Lee Hinde wrote:
On 3-8-2012 18:23, Lee Hinde wrote:
>
> On Aug 3, 2012, at 9:01 AM, Melvyn Sopacua wrote:
>
>> On 3-8-2012 17:37, Lee Hinde wrote:
>>
>>> self.fields['photo_response'].widget.attrs["class"] = 'date-field
>>> input-small'
>>> self.fields['photo_response'].widget.format = '%m-%d-%Y'
> Thanks, th
On Aug 3, 2012, at 9:01 AM, Melvyn Sopacua wrote:
> On 3-8-2012 17:37, Lee Hinde wrote:
>
>> self.fields['photo_response'].widget.attrs["class"] = 'date-field
>> input-small'
>> self.fields['photo_response'].widget.format = '%m-%d-%Y'
>>
>>
>> is there a way to consolidate this sort of thing
On 3-8-2012 17:37, Lee Hinde wrote:
> self.fields['photo_response'].widget.attrs["class"] = 'date-field input-small'
> self.fields['photo_response'].widget.format = '%m-%d-%Y'
>
>
> is there a way to consolidate this sort of thing, such that if a field
> is a date field, it always gets these set
I have a lot of this throughout my forms.py files:
self.fields['verification_date'].widget.attrs["class"] = 'date-field
input-small'
self.fields['verification_date'].widget.format = '%m-%d-%Y'
self.fields['mail_response'].widget.attrs["class"] = 'date-field input-small'
self.fields['mail_respons
5 matches
Mail list logo