Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _check_valid_coordinates1(self):
- if self.latitude < -90 or self.latitude > 90:
- raise exceptions.ValidationError("Latitude value must be between -90 and 90")
- if self.longitude < -180 or self.longitude > 180:
- raise exceptions.ValidationError("Longitude value must be between -180 and 180")
- def _check_valid_coordinates2(self):
- if -90 >= self.latitude <= 90:
- pass
- else:
- raise exceptions.ValidationError("Latitude value must be between -90 and 90")
- if -180 >= self.longitude <= 180:
- pass
- else:
- raise exceptions.ValidationError("Longitude value must be between -180 and 180")
- def _check_valid_coordinates3(self):
- if not -90 >= self.latitude <= 90:
- raise exceptions.ValidationError("Latitude value must be between -90 and 90")
- if not -180 >= self.longitude <= 180:
- raise exceptions.ValidationError("Longitude value must be between -180 and 180")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement