本文整理汇总了Python中tiddlyweb.model.tiddler.Tiddler.fields['foo']方法的典型用法代码示例。如果您正苦于以下问题:Python Tiddler.fields['foo']方法的具体用法?Python Tiddler.fields['foo']怎么用?Python Tiddler.fields['foo']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tiddlyweb.model.tiddler.Tiddler
的用法示例。
在下文中一共展示了Tiddler.fields['foo']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_lt_gt
# 需要导入模块: from tiddlyweb.model.tiddler import Tiddler [as 别名]
# 或者: from tiddlyweb.model.tiddler.Tiddler import fields['foo'] [as 别名]
def test_lt_gt():
tiddlers = []
dummy = "20050322134706"
dates = ["20091203","20081203","20080403","20090903","20090331","20071103",dummy,dummy,dummy,dummy,dummy,dummy]
for i in [1,2,4,6,10,12,55,90,100,201,323,2223]:#12
tid = Tiddler("foo%s"%i)
tid.fields['foo'] = "%s"%i
try:
tid.modified = dates.pop()
except IndexError:
pass
tiddlers.append(tid)
restiddlers = ltgt.lt("foo:10",tiddlers)
result = []
for tid in restiddlers:
result.append(tid)
assert 4 is len(result)
restiddlers = ltgt.lt("foo:1",tiddlers)
result = []
for tid in restiddlers:
result.append(tid)
assert 0 is len(result)
restiddlers = ltgt.gt("foo:300",tiddlers)
result = []
for tid in restiddlers:
result.append(tid)
assert 2 is len(result)
restiddlers = ltgt.gt("modified:20081101",tiddlers)
result = []
for tid in restiddlers:
print tid.modified
result.append(tid)
assert 4 is len(result)
restiddlers = ltgt.lt("modified:20050323",tiddlers)
result = []
for tid in restiddlers:
print tid.modified
result.append(tid)
assert 6 is len(result)