views.py 文件源码

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

项目:bcsmssa 作者: CodeTheChangeUBC 项目源码 文件源码
def get_context_data(self, **kwargs):
        context = super(DetailView, self).get_context_data(**kwargs)
        context['user'] = self.request.user
        context['users'] = User.objects.all()   

        # Send list of keys to front end if the request came from the admin
        if self.request.user.is_superuser:
            keys = InviteKey.objects.all()
            context['keys'] = keys
        return context 




# Use Django's built in login system but redirect to the homepage if already
# logged in
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号