def get_provider_network_count(self): sources = ProviderNetworkConnection.query( ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == True).count() targets = ProviderNetworkConnection.query( ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == True).count() return sources + targets
def get_provider_network(self): sources = ProviderNetworkConnection.query(ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == True).fetch() targets = ProviderNetworkConnection.query(ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == True).fetch() provider_keys = [] for connect in sources: provider_keys.append(connect.target_provider) for connect in targets: provider_keys.append(connect.source_provider) providers = ndb.get_multi(provider_keys) return providers
def get_provider_network_rejectee_count(self): sources = ProviderNetworkConnection.query( ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).count() return sources
def get_provider_network_rejecter_count(self): targets = ProviderNetworkConnection.query( ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).count() return targets
def get_provider_network_rejected(self): targets = ProviderNetworkConnection.query(ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).fetch() providers = [] for connect in targets: providers.append(connect.source_provider.get()) return providers
def get_provider_network(self): sources = ProviderNetworkConnection.query( ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == True).fetch() targets = ProviderNetworkConnection.query( ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == True).fetch() provider_keys = [] for connect in sources: provider_keys.append(connect.target_provider) for connect in targets: provider_keys.append(connect.source_provider) providers = ndb.get_multi(provider_keys) return providers
def get_provider_network_rejected(self): targets = ProviderNetworkConnection.query( ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).fetch() providers = [] for connect in targets: providers.append(connect.source_provider.get()) return providers
def get_provider_network_pending_connections(self): return ProviderNetworkConnection.query(ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == False).fetch()
def get_provider_network_rejectee_count(self): sources = ProviderNetworkConnection.query(ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).count() return sources
def get_provider_network_rejecter_count(self): targets = ProviderNetworkConnection.query(ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == True).count() return targets
def get_provider_network_count(self): sources = ProviderNetworkConnection.query(ProviderNetworkConnection.source_provider == self.key, ProviderNetworkConnection.confirmed == True).count() targets = ProviderNetworkConnection.query(ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == True).count() return sources + targets
def get_provider_network_connection(source_key, target_key): return ProviderNetworkConnection.query( ProviderNetworkConnection.source_provider == source_key, ProviderNetworkConnection.target_provider == target_key).get()
def get_provider_network_connection(source_key, target_key): return ProviderNetworkConnection.query(ProviderNetworkConnection.source_provider == source_key, ProviderNetworkConnection.target_provider == target_key).get()
def get_provider_network_pending_connections(self): return ProviderNetworkConnection.query( ProviderNetworkConnection.target_provider == self.key, ProviderNetworkConnection.confirmed == False, ProviderNetworkConnection.rejected == False).fetch()