指定查询返回结果中包含关联表字段。

        :param keys: 关联子表字段名
        :rtype: Query
761395
def include(self, *keys):
        
        if len(keys) == 1 and isinstance(keys[0], (list, tuple)):
            keys = keys[0]
        self._include += keys
        return self
327953
def get_bindings_for_keys(self, keys):
        
        def get():
            result = []
            for b in self.key_bindings:
                if len(keys) == len(b.keys):
                    match = True
                    any_count = 0

                    for i, j in zip(b.keys, keys):
                        if i != j and i != Keys.Any:
                            match = False
                            break

                        if i == Keys.Any:
                            any_count += 1

                    if match:
                        result.append((any_count, b))

            # Place bindings that have more 'Any' occurences in them at the end.
            result = sorted(result, key=lambda item: -item[0])

            return [item[1] for item in result]

        return self._get_bindings_for_keys_cache.get(keys, get)
1328629
def map_query_string(self):
        
        if (not self.query_key_mapper or
            self.request.method == 'POST'):
            # Nothing to map, don't do anything.
            # return self.request.POST
            return {}

        keys = list(self.query_key_mapper.keys())

        return {self.query_key_mapper.get(k) if k in keys else k: v.strip()
                for k, v in self.request.GET.items()}
263487
def where(self, key, operator, value):
        
        self.__store_query({"key": key, "operator": operator, "value": value})
        return self
1205662
def key(self, key=""):
    
    params = join_params(self.parameters, {"key": key})

    return self.__class__(**params)
494623
public Entity filter(String... keys) {
		final Entity result = new Entity(this.tableName);
		result.setFieldNames(this.fieldNames);

		for (String key : keys) {
			if(this.containsKey(key)) {
				result.put(key, this.get(key));
			}
		}
		return result;
	}
147712
def matches_query(self, key, query):
        
        dumped = query.dump()
        dumped['className'] = query._query_class._class_name
        self._add_condition(key, '$inQuery', dumped)
        return self
16921
def Search(self,key):
		

		results = []
		for group in self.groups:
			if group.id.lower().find(key.lower()) != -1:  results.append(group)
			elif group.name.lower().find(key.lower()) != -1:  results.append(group)
			elif group.description.lower().find(key.lower()) != -1:  results.append(group)

		return(results)
975891
def prepare_query_params(**kwargs):
    
    return [
        (sub_key, sub_value)
        for key, value in kwargs.items()
        for sub_key, sub_value in expand(value, key)
        if sub_value is not None
    ]
216959
function iterateKeys(keys) {
    async.forEach(keys, readKey, function (err) {
      return err ? callback(err) : callback(null, keyinfo);
    });
  }
1129409
def resolve_keys(self, keys, auto_create=False):
        
        resolved = {}
        success = True
        for key in keys:
            if auto_create:
                resolved[key] = self.find(*key)
            else:
                try:
                    resolved[key] = self.get_by_natural_key(*key)
                except self.model.DoesNotExist:
                    success = False
                    resolved[key] = None
        return resolved, success
337240
def _keys(result, key_ary, hash)
      hash.each do |key, value|
        key_ary << key
        result << "/#{key_ary.join('/')}"
        _keys(result, key_ary, value) if value.is_a?(Hash)
        key_ary.pop
      end
    end
590000
public Set<DOCUMENT> query(@NonNull Iterable<KEY> keys, @NonNull Predicate<? super DOCUMENT> filter) {
      return Streams.asParallelStream(keys)
                    .flatMap(key -> index.get(key).stream())
                    .map(documents::get)
                    .filter(filter)
                    .collect(Collectors.toSet());
   }
847763
def remove(self, *keys):
        
        keys = list(map(self.get_key, keys))
        return self._client.delete(*keys)
1358472
async def ListKeys(self, entities, mode):
        '''
        
        '''
        # map input types to rpc msg
        _params = dict()
        msg = dict(type='KeyManager',
                   request='ListKeys',
                   version=1,
                   params=_params)
        _params['entities'] = entities
        _params['mode'] = mode
        reply = await self.rpc(msg)
        return reply
133540
def keys(self, index=None):
        
        if index is not None and index not in self._indexes:
            raise ValueError('Index {} does not exist'.format(index))

        db = self._indexes[index][0] if index else self._main_db
        with self._lmdb.begin(db=db) as txn:
            return [
                key.decode()
                for key in txn.cursor().iternext(keys=True, values=False)
            ]
8390
def index(self, key):
        
        if is_iterable(key):
            return [self.index(subkey) for subkey in key]
        return self.map[key]