|
@@ -7,39 +7,43 @@
|
7
|
7
|
|
8
|
8
|
class DummyDatasource(object):
|
9
|
9
|
|
10
|
|
- def __init__(self, options=None):
|
11
|
|
- self.options = options
|
|
10
|
+ def __init__(self, module=None, *conn_args, **conn_kargs):
|
|
11
|
+ self.module = module
|
|
12
|
+ self.conn_args = conn_args
|
|
13
|
+ self.conn_kargs = conn_kargs
|
|
14
|
+
|
|
15
|
+ ## @brief update an existing LeObject
|
|
16
|
+ # @param lodel_id (int) : list of lodel_id
|
|
17
|
+ # @param checked_data dict
|
|
18
|
+ # @param datasource_filters (string)
|
|
19
|
+ def update(self, lodel_id, checked_data, datasource_filters):
|
|
20
|
+ print ("DummyDatasource.update: ", lodel_id, checked_data, datasource_filters)
|
|
21
|
+ return True
|
12
|
22
|
|
13
|
23
|
## @brief create a new LeObject
|
|
24
|
+ # @param typename string
|
|
25
|
+ # @param classname string
|
14
|
26
|
# @param data dict: a dictionnary of field:value to save
|
15
|
27
|
# @return lodel_id int: new lodel_id of the newly created LeObject
|
16
|
|
- def insert(self, data):
|
17
|
|
- print("DummyDatasource.insert: ", data)
|
|
28
|
+ def insert(self, typename, classname, **datas):
|
|
29
|
+ print("DummyDatasource.insert: ", typename, classname, datas)
|
18
|
30
|
return 42
|
19
|
31
|
|
20
|
|
- ## @brief update an existing LeObject
|
21
|
|
- # @param lodel_id int | (int): lodel_id of the object(s) where to apply changes
|
22
|
|
- # @param data dict: dictionnary of field:value to save
|
23
|
|
- # @param update_filters string | (string): list of string of update filters
|
24
|
|
- # @return okay bool: True on success, it will raise on failure
|
25
|
|
- def update(self, lodel_id, data, update_filters=None):
|
26
|
|
- print("DummyDatasource.update: ", lodel_id, data, update_filters)
|
27
|
|
-
|
28
|
|
- return True
|
29
|
|
-
|
30
|
32
|
## @brief delete an existing LeObject
|
31
|
33
|
# @param lodel_id int | (int): lodel_id of the object(s) to delete
|
32
|
34
|
# @param delete_filters string | (string): list of string of delete filters
|
33
|
35
|
# @return okay bool: True on success, it will raise on failure
|
34
|
36
|
def delete(self, lodel_id, delete_filters=None):
|
35
|
37
|
print("DummyDatasource.delete: ", lodel_id, delete_filters)
|
36
|
|
-
|
37
|
38
|
return True
|
38
|
39
|
|
39
|
|
- ## @brief make a search to retrieve a collection of LeObject
|
40
|
|
- # @param query_filters string | (string): list of string of query filters
|
|
40
|
+ ## @brief search for a collection of objects
|
|
41
|
+ # @param emclass LeClass : LeClass instance
|
|
42
|
+ # @param emtype LeType : LeType instance
|
|
43
|
+ # @param field_list list : list of fields to get from the datasource
|
|
44
|
+ # @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
|
|
45
|
+ # @param relational_filters
|
41
|
46
|
# @return responses ({string:*}): a list of dict with field:value
|
42
|
|
- def get(self, query_filters):
|
43
|
|
- print("DummyDatasource.get: ", query_filters)
|
44
|
|
-
|
45
|
|
- return False
|
|
47
|
+ def get(self, emclass, emtype, field_list, filters, relational_filters):
|
|
48
|
+ print("DummyDatasource.get: ", emclass, emtype, field_list, filters, relational_filters)
|
|
49
|
+ return []
|