|
@@ -76,6 +76,8 @@ class MongoDbDatasource(object):
|
76
|
76
|
tuid = target._uid[0] # Multiple UID broken here
|
77
|
77
|
results = self.select(
|
78
|
78
|
target, [tuid], [], order=[(tuid, 'DESC')], limit = 1)
|
|
79
|
+ if len(results) == 0:
|
|
80
|
+ return 1
|
79
|
81
|
return results[0][tuid]+1
|
80
|
82
|
|
81
|
83
|
##@brief returns a selection of documents from the datasource
|
|
@@ -96,9 +98,10 @@ class MongoDbDatasource(object):
|
96
|
98
|
if target.is_abstract():
|
97
|
99
|
target_childs = target.child_classes()
|
98
|
100
|
for target_child in target_childs:
|
99
|
|
- results.append(self.select(target=target_child, field_list=field_list, filters=filters,
|
100
|
|
- rel_filters=rel_filters, order=order, group=group, limit=limit,
|
101
|
|
- offset=offset))
|
|
101
|
+ results += self.select(
|
|
102
|
+ target=target_child, field_list=field_list,
|
|
103
|
+ filters=filters, rel_filters=rel_filters, order=order,
|
|
104
|
+ group=group, limit=limit, offset=offset)
|
102
|
105
|
else:
|
103
|
106
|
# Default arg init
|
104
|
107
|
filters = [] if filters is None else filters
|