@@ -140,24 +140,24 @@ def save(self, force_insert=False, force_update=False, commit=True):
140140 area .save ()
141141 return area
142142
143- class AddAreaForm (forms .Form ):
144- acronym = forms .CharField (max_length = 16 ,required = True )
145- name = forms .CharField (max_length = 80 ,required = True )
146- status = forms .IntegerField (widget = forms .Select (choices = STATE_CHOICES ),required = True )
147- start_date = forms .DateField ()
148- comments = forms .CharField (widget = forms .Textarea (attrs = {'rows' :'1' }),required = False )
149-
150- def clean_acronym (self ):
151- # get name, strip leading and trailing spaces
152- name = self .cleaned_data .get ('acronym' , '' ).strip ()
153- # check for invalid characters
154- r1 = re .compile (r'[a-zA-Z\-\. ]+$' )
155- if name and not r1 .match (name ):
156- raise forms .ValidationError ("Enter a valid acronym (only letters,period,hyphen allowed)" )
157- # ensure doesn't already exist
158- if Acronym .objects .filter (acronym = name ):
159- raise forms .ValidationError ("This acronym already exists. Enter a unique one." )
160- return name
143+ # class AddAreaForm(forms.Form):
144+ # acronym = forms.CharField(max_length=16,required=True)
145+ # name = forms.CharField(max_length=80,required=True)
146+ # status = forms.IntegerField(widget=forms.Select(choices=STATE_CHOICES),required=True)
147+ # start_date = forms.DateField()
148+ # comments = forms.CharField(widget=forms.Textarea(attrs={'rows':'1'}),required=False)
149+ #
150+ # def clean_acronym(self):
151+ # # get name, strip leading and trailing spaces
152+ # name = self.cleaned_data.get('acronym', '').strip()
153+ # # check for invalid characters
154+ # r1 = re.compile(r'[a-zA-Z\-\. ]+$')
155+ # if name and not r1.match(name):
156+ # raise forms.ValidationError("Enter a valid acronym (only letters,period,hyphen allowed)")
157+ # # ensure doesn't already exist
158+ # if Group .objects.filter(acronym=name).exists( ):
159+ # raise forms.ValidationError("This acronym already exists. Enter a unique one.")
160+ # return name
161161
162162class AreaDirectorForm (forms .Form ):
163163 ad_name = forms .CharField (max_length = 100 ,label = 'Name' ,help_text = "To see a list of people type the first name, or last name, or both." )
0 commit comments