示例#1
0
 def clean_location(self):
     name = self.cleaned_data['location']
     try:
         get_location_id(name)
         return name
     except:
         raise ValidationError('Location does not exist.')
示例#2
0
 def get_location_id(self):
     return get_location_id(self.location)