basetags.py 文件源码

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

项目:WorldsAtWar 作者: heidi666 项目源码 文件源码
def bgchoice(context):

    background = GlobalData.objects.get(pk=1).turnbackground

    request = context['request']
    try:
        world = World.objects.get(user=request.user)
    except:
        return static('backgrounds/%s.gif' % background)
    else:
        if world.backgroundpref == -1:
            return static('backgrounds/%s.gif' % v.background())
        elif world.backgroundpref == -2:
            return static('backgrounds/%s.gif' % background)
        else:
            return static('backgrounds/%s.gif' % world.backgroundpref)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号