def parent_location(self): location = self.locations.all()[0] from survey.models import LocationTypeDetails second_lowest_level_type = LocationTypeDetails.get_second_lowest_level_type() return location.get_ancestors().filter(type=second_lowest_level_type)[0]
def selected_type_is_second_lowest(self): return self.selected_location.type == LocationTypeDetails.get_second_lowest_level_type( )
def selected_type_is_second_lowest(self): return self.selected_location.type == LocationTypeDetails.get_second_lowest_level_type()