本文整理汇总了Python中dungeon.Dungeon.save方法的典型用法代码示例。如果您正苦于以下问题:Python Dungeon.save方法的具体用法?Python Dungeon.save怎么用?Python Dungeon.save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dungeon.Dungeon
的用法示例。
在下文中一共展示了Dungeon.save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addmonster
# 需要导入模块: from dungeon import Dungeon [as 别名]
# 或者: from dungeon.Dungeon import save [as 别名]
def addmonster(request):
d = Dungeon()
d.load(int(request.POST["did"]))
d.addmon(request.POST["data"])
d.save()
monster_infos = []
for i in MonsterDB.objects.all():
mon = {}
mon["id"] = "%d" % i.mid
mon["name"] = i.name
monster_infos.append(mon)
ailist = []
for i in actmode.actionmodelist:
ai = {}
ai["id"] = "%d" % i.id
ai["name"] = i.name
ailist.append(ai)
skill_list = []
for i in skills.skilllist:
sk = {}
sk["id"] = "%d" % i.id
sk["name"] = i.name
skill_list.append(sk)
response = render_to_response('dungeonmod_basic.tpl', {"did":request.POST["did"], "name":d.name, "minfo":monster_infos, "ailist":ailist, "sk":skill_list, "data":d.data}, context_instance=RequestContext(request))
if 'text/html' in response['Content-Type']:
response.content = short(response.content)
return response
示例2: adddungeon
# 需要导入模块: from dungeon import Dungeon [as 别名]
# 或者: from dungeon.Dungeon import save [as 别名]
def adddungeon(request):
d = Dungeon()
d.name = request.POST[u'dname']
if 'yes' in request.POST[u'rbb']:
d.resetbybattle = 1
else:
d.resetbybattle = 0
d.save()
return HttpResponseRedirect("/dungeon/show/")