本文整理匯總了Python中tornado.util.ObjectDict.order方法的典型用法代碼示例。如果您正苦於以下問題:Python ObjectDict.order方法的具體用法?Python ObjectDict.order怎麽用?Python ObjectDict.order使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tornado.util.ObjectDict
的用法示例。
在下文中一共展示了ObjectDict.order方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _form_upload_post
# 需要導入模塊: from tornado.util import ObjectDict [as 別名]
# 或者: from tornado.util.ObjectDict import order [as 別名]
#.........這裏部分代碼省略.........
LOGGER.warn("setting 'attachment_path' not found")
ctx.errors._global = "Attachment directory not specified"
send_status(500, ctx)
return
try:
yield data.validate_model(ctx.model)
except Exception as e:
LOGGER.error("model validation error: %s", e)
ctx.errors._global = "Model validation error"
send_status(500, ctx)
return
idx = -1
if outputMode in [1, 2]:
# First line of data file is initial
# values BEFORE the first element.
idx = 0
model_elements = []
lattice_elements = yield data.find_lattice_elements_by_lattice_id(
ctx.model.lattice_id)
for lattice_element in lattice_elements:
for p in lattice_element.properties:
if p.name == "ITYPE":
elem_itype = p.value
break
else:
ctx.errors._global = ("Lattice Element ({}) missing ITYPE property"
.format(lattice_element.order))
send_status(400, ctx)
return
for p in lattice_element.properties:
if p.name == "STEPS":
elem_steps = p.value
break
else:
ctx.errors._global = ("Lattice Element ({}) missing STEPS property"
.format(lattice_element.order))
send_status(400, ctx)
return
if outputMode in [1, 2]:
loop = elem_steps
if elem_itype in [ -2, 4 ]:
# no output for these elements
loop = 0
elif elem_itype < 0:
loop = elem_steps + 1
elif outputMode in [3, 4]:
loop = 0
if elem_itype == -28:
# only output from monitor
loop = 1
elif outputMode in [5, 6]:
loop = 1
for _ in range(loop):
idx += 1