def __init__(self, *args, **kwargs):
# Create the QuerySequence object where most of the magic happens.
if 'query' not in kwargs:
kwargs['query'] = QuerySequence(*args)
elif args:
raise ValueError(
"Cannot provide args and a 'query' keyword argument.")
# If a particular Model class is not provided, just use the generic
# model class.
# TODO Dynamically generate the fields available in this model via
# introspection of the input QuerySets.
if 'model' not in kwargs:
kwargs['model'] = QuerySetSequenceModel
super(QuerySetSequence, self).__init__(**kwargs)
# Override the iterator that will be used. (Currently used only in
# Django >= 1.11.)
self._iterable_class = SequenceIterable
评论列表
文章目录