(self, type_code)
Returns the ancestor of given location_type_code of the location
Returns the ancestor of given location_type_code of the location
Returns the ancestor of given location_type_code of the location
def get_ancestor_of_type(self, type_code):
        """
        Returns the ancestor of given location_type_code of the location
        """
        try:
            return self.get_ancestors().get(location_type__code=type_code)
        except self.DoesNotExist:
            return None
def get_ancestor_of_type ( self , type_code ) : try : return self . get_ancestors ( ) . get ( location_type__code = type_code ) except self . DoesNotExist : return None