__init__.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:django-querysetsequence 作者: percipient 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号