comparison gpp/bio/forms.py @ 197:2baadae33f2e

Got autocomplete working for the member search. Updated django and ran into a bug where url tags with comma separated kwargs starting consuming tons of CPU throughput. The work-around is to cut over to using spaces between arguments. This is now allowed to be consistent with other tags. Did some query optimization for the news app.
author Brian Neal <bgneal@gmail.com>
date Sat, 10 Apr 2010 04:32:24 +0000
parents ab7830b067b3
children 272d3a8c98e8
comparison
equal deleted inserted replaced
196:893b6d462cf9 197:2baadae33f2e
118 """ 118 """
119 A form to search for users. 119 A form to search for users.
120 """ 120 """
121 username = forms.CharField(max_length=30, widget=AutoCompleteUserInput()) 121 username = forms.CharField(max_length=30, widget=AutoCompleteUserInput())
122 122
123 class Media:
124 css = {
125 'all': settings.GPP_THIRD_PARTY_CSS['jquery-ui']
126 }
127 js = settings.GPP_THIRD_PARTY_JS['jquery-ui']
128
123 def clean_username(self): 129 def clean_username(self):
124 username = self.cleaned_data['username'] 130 username = self.cleaned_data['username']
125 try: 131 try:
126 User.objects.get(username=username, is_active=True) 132 User.objects.get(username=username, is_active=True)
127 except User.DoesNotExist: 133 except User.DoesNotExist: