Changeset 3496370
- Timestamp:
- Jul 6, 2012, 2:49:11 AM (14 years ago)
- Branches:
- master, space-access, stable, stage
- Children:
- cbdbd1f
- Parents:
- cd98e17
- git-author:
- Alex Dehnert <adehnert@…> (07/06/12 02:33:16)
- git-committer:
- Alex Dehnert <adehnert@…> (07/06/12 02:49:11)
- Location:
- asadb/forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
asadb/forms/models.py
ra03cb61 r3496370 11 11 class FYSM(models.Model): 12 12 group = models.ForeignKey(groups.models.Group, db_index=True, ) 13 display_name = models.CharField(max_length=50 )13 display_name = models.CharField(max_length=50, help_text="""Form of your name suitable for display (for example, don't end your name with ", MIT")""") 14 14 year = models.IntegerField(db_index=True, ) 15 15 website = models.URLField() -
asadb/forms/views.py
rcd98e17 r3496370 17 17 from django.forms import ModelForm 18 18 from django.forms import ModelChoiceField, ModelMultipleChoiceField 19 from django.forms import ValidationError 19 20 from django.db import connection 20 21 from django.db.models import Q, Count … … 149 150 ) 150 151 152 def clean_display_name(self, ): 153 name = self.cleaned_data['display_name'] 154 if ',' in name: 155 raise ValidationError("""In general, commas in a display name are a mistake and will look bad (group names like "Punctuation Society, MIT" should probably be "Punctuation Society"). If you do want a comma, contact asa-fysm@mit.edu and we'll put it in for you.""") 156 return name 157 151 158 @login_required 152 159 def fysm_manage(request, group, ):
Note: See TracChangeset
for help on using the changeset viewer.