本文整理汇总了Python中tiddlyweb.model.tiddler.Tiddler.fields['climbtype']方法的典型用法代码示例。如果您正苦于以下问题:Python Tiddler.fields['climbtype']方法的具体用法?Python Tiddler.fields['climbtype']怎么用?Python Tiddler.fields['climbtype']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tiddlyweb.model.tiddler.Tiddler
的用法示例。
在下文中一共展示了Tiddler.fields['climbtype']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: record_climbs
# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import fields['climbtype'] [as 别名]
def record_climbs(environ, start_response):
"""
Record a climb that has been accomplished.
"""
query = environ['tiddlyweb.query']
store = environ['tiddlyweb.store']
current_user = environ['tiddlyweb.usersign']['name']
gym = get_route_value(environ, 'gym')
routes = query['route']
dones = query['doneroute']
for index, value in enumerate(dones):
if value != '':
route_title = routes[index]
tiddler = Tiddler(route_title, current_user)
try:
tiddler = store.get(tiddler)
except StoreError:
pass
if value in CLEAN_CLIMB:
try:
tiddler.tags.remove('tickwish')
except ValueError:
pass
tiddler.fields['climbtype'] = value
tiddler.fields['gym'] = gym
tiddler.tags.append('climb')
store.put(tiddler)
raise HTTP303(server_base_url(environ) + environ['REQUEST_URI'])