views.py 文件源码

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

项目:django-endless-pagination-vue 作者: mapeveri 项目源码 文件源码
def get_context_object_name(self, object_list):
        """Get the name of the item to be used in the context.

        See original in ``django.views.generic.list.MultipleObjectMixin``.
        """
        if self.context_object_name:
            return self.context_object_name
        elif hasattr(object_list, 'model'):
            object_name = object_list.model._meta.object_name.lower()
            return smart_str('{0}_list'.format(object_name))
        else:
            return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号