def clean_smd(self):
		# Check that the SMD is an SMD of the given ANC.
		try:
			smd = "%02d" % int(self.cleaned_data['smd'])
		except __HOLE__:
			raise forms.ValidationError("An SMD looks like 01, 02, ...")
		anc = self.cleaned_data['anc']
		smd_list = anc_data[anc[0]]['ancs'][anc[1]]['smds'].keys()
		if smd not in smd_list:
			raise forms.ValidationError("That's not an SMD in %s." % anc)
		return smd
dataset/ETHPy150Open codefordc/ancfinder/ancfindersite/backend_views.py/SMDUpdateForm.clean_smd