def config_entity_has_primary_geography(self):
     """
         Returns True if a primary geography exists at this ConfigEntity scope (not necessarily the geography_scope),
         meaning that at least one of its DbEntities is configured as a primary_geography. It checks this
         by verifying that the geography table of the dynamic Geography class for this config_entity exists
     """
     return any_true(
         lambda db_entity: db_entity.feature_class_configuration and \
                           db_entity.feature_class_configuration.primary_geography,
         self.config_entity.owned_db_entities())
示例#2
0
 def properties_have_changed(self, property_dict, *properties):
     return any_true(lambda property:
                         normalize_null(get_property_path(self, property)) !=
                         normalize_null(get_property_path(property_dict, property)),
                     properties)
示例#3
0
 def has_behavior(self, behavior, seen=[]):
     return self==behavior or any_true(lambda parent_behavior: parent_behavior.has_behavior(behavior, seen+[self]),
                                       filter(lambda behavior: behavior not in seen, self.parents.all()))