comparison custom_search/forms.py @ 729:99d7bf8cd712

Changed the search input type to search for HTML5.
author Brian Neal <bgneal@gmail.com>
date Sun, 06 Oct 2013 14:48:42 -0500
parents ee87ea74d46b
children ad53d929281a
comparison
equal deleted inserted replaced
728:60fb45446e3b 729:99d7bf8cd712
24 This customized ModelSearchForm allows us to explictly label and order 24 This customized ModelSearchForm allows us to explictly label and order
25 the model choices. 25 the model choices.
26 26
27 """ 27 """
28 q = forms.CharField(required=False, label='', 28 q = forms.CharField(required=False, label='',
29 widget=forms.TextInput(attrs={'class': 'text', 'size': 48})) 29 widget=forms.TextInput(attrs={'type': 'search',
30 'class': 'search',
31 'size': 48,
32 }))
30 33
31 def __init__(self, *args, **kwargs): 34 def __init__(self, *args, **kwargs):
32 super(CustomModelSearchForm, self).__init__(*args, **kwargs) 35 super(CustomModelSearchForm, self).__init__(*args, **kwargs)
33 self.fields['models'] = forms.MultipleChoiceField(choices=MODEL_CHOICES, 36 self.fields['models'] = forms.MultipleChoiceField(choices=MODEL_CHOICES,
34 label='', widget=forms.CheckboxSelectMultiple) 37 label='', widget=forms.CheckboxSelectMultiple)