我基本上是在尝试导入我为我的应用创建的“模块”,并且可以访问应该存在于应用中的变量,以及一些帮助功能。
我的模块如下:
import * as immutable from 'immutable';
const treeduxTrunk = immutable.Map();
export function setBranch( branchName: string, twigStruct: Object ) {
treeduxTrunk.set( branchName, twigStruct );
}
export default treeduxTrunk;
我的应用文件:
import trunk = require('../treedux/lib/treeduxTrunk');
treeduxTrunk.setBranch( 'route1', {
users: 'nothing',
products: 13
});
console.log( treeduxTrunk.default );
目前的结果是:
Map {size:0,_root:undefined,__ ownerID:undefined,__ shash:undefined,__altered:false}
我期待它的大小大于0,准确的是我期待1。
关于我做错了什么的任何想法?
提前致谢,
TF
答案 0 :(得分:0)
public static ParseResult parse(String)
introduce a parameter object。
试试这个:
# filter start and end date
matches = database.objects.filter(start__gte=Start, end__lte=End)
# iterate through matches
for item in matches:
# filter database again and get the id of the first element matched
first_item = database.objects.filter(cm1=item.cm1, cm2=item.cm2, cm3=item.cm3).values('id').first()
# compare first item id with the id of filtered "item"
if first_item['id'] == item.id:
TrueRun = True
else:
TrueRun = False