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)
评论列表
文章目录