views.py 文件源码

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

项目:django-dynamic-views 作者: ddaan 项目源码 文件源码
def get_context_data(self, **kwargs):
        context = super(DynamicDeleteView, self).get_context_data(**kwargs)

        collector = Collector(using='default') # or specific database
        collector.collect([self.object])
        to_delete = collector.instances_with_model()
        context['to_delete_list'] = []

        for x, y in to_delete:
            context['to_delete_list'].append((x.__name__, y,))

        return context
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号