views.py 文件源码

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

项目:API-Manager 作者: OpenBankProject 项目源码 文件源码
def get_context_data(self, **kwargs):
        context = super(DetailView, self).get_context_data(**kwargs)
        api = API(self.request.session.get('obp'))

        try:
            urlpath = '/management/consumers/{}'.format(kwargs['consumer_id'])
            consumer = api.get(urlpath)
            consumer['created'] = datetime.strptime(
                consumer['created'], settings.API_DATETIMEFORMAT)
        except APIError as err:
            messages.error(self.request, err)

        context.update({
            'consumer': consumer,
        })
        return context
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号