Mercurial > public > sg101
comparison bio/forms.py @ 1017:21c592cac71c
ManifestStaticFilesStorage: stop using form Media.
It's okay for the admin, but not for user facing stuff.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 06 Dec 2015 14:48:30 -0600 |
parents | 164a39d985ef |
children | 6bf83070b19f |
comparison
equal
deleted
inserted
replaced
1016:fd70e9d547ed | 1017:21c592cac71c |
---|---|
48 class Meta: | 48 class Meta: |
49 model = UserProfile | 49 model = UserProfile |
50 fields = ('location', 'country', 'birthday', 'occupation', 'interests', | 50 fields = ('location', 'country', 'birthday', 'occupation', 'interests', |
51 'profile_text', 'hide_email', 'signature', 'time_zone', | 51 'profile_text', 'hide_email', 'signature', 'time_zone', |
52 'use_24_time', 'auto_favorite', 'auto_subscribe') | 52 'use_24_time', 'auto_favorite', 'auto_subscribe') |
53 | |
54 class Media: | |
55 css = { | |
56 'all': (settings.GPP_THIRD_PARTY_CSS['markitup'] + | |
57 settings.GPP_THIRD_PARTY_CSS['jquery-ui']) | |
58 } | |
59 js = (settings.GPP_THIRD_PARTY_JS['markitup'] + | |
60 settings.GPP_THIRD_PARTY_JS['jquery-ui'] + | |
61 ['js/bio.js', 'js/timezone.js']) | |
62 | 53 |
63 def clean_time_zone(self): | 54 def clean_time_zone(self): |
64 """Ensure the timezone is valid and will work with pytz. | 55 """Ensure the timezone is valid and will work with pytz. |
65 | 56 |
66 A blank (empty) value is allowed. | 57 A blank (empty) value is allowed. |
143 """ | 134 """ |
144 A form to search for users. | 135 A form to search for users. |
145 """ | 136 """ |
146 username = forms.CharField(max_length=30, widget=AutoCompleteUserInput()) | 137 username = forms.CharField(max_length=30, widget=AutoCompleteUserInput()) |
147 | 138 |
148 class Media: | |
149 css = { | |
150 'all': settings.GPP_THIRD_PARTY_CSS['jquery-ui'] | |
151 } | |
152 js = settings.GPP_THIRD_PARTY_JS['jquery-ui'] | |
153 | |
154 def clean_username(self): | 139 def clean_username(self): |
155 username = self.cleaned_data['username'].strip() | 140 username = self.cleaned_data['username'].strip() |
156 try: | 141 try: |
157 User.objects.get(username=username, is_active=True) | 142 User.objects.get(username=username, is_active=True) |
158 except User.DoesNotExist: | 143 except User.DoesNotExist: |