return self.datas.keys()
res = []
- counter = 0
+ counter = 1
#Find the value of dict
f = False
if result:
for id, data in self.datas.items():
- counter = counter + 1
data['id'] = id
- if limit and (counter > int(limit)):
+ # If no offset, give the first entries between 0 and the limit
+ if not offset and limit and (counter > int(limit)):
+ break
+ # If offset, give only entries between offset and the offset+limit
+ elif offset and limit and (counter > int(limit + offset)):
break
f = True
for arg in result:
val = eval('data[arg[0]]'+arg[1] +' arg[2]', locals())
elif arg[1] in ['ilike']:
val = (str(data[arg[0]]).find(str(arg[2]))!=-1)
-
f = f and val
-
if f:
- res.append(id)
+ if counter > offset:
+ res.append(id)
+ counter += 1
if count:
return len(res)
return res or []