Exemple #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.')
Exemple #2
0
 def get_location_id(self):
     return get_location_id(self.location)