|
@@ -0,0 +1,38 @@
|
|
1
|
+#-*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+## Generic DataSource for LeObject
|
|
4
|
+
|
|
5
|
+class LeDataSource(object):
|
|
6
|
+
|
|
7
|
+ def __init__(self, options=None):
|
|
8
|
+ self.options = options
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+ ## @brief update an existing LeObject
|
|
12
|
+ # @param lodel_id (int) : list of lodel_id
|
|
13
|
+ # @param checked_data dict
|
|
14
|
+ # @param datasource_filters (string)
|
|
15
|
+ def update(self, lodel_id, checked_data, datasource_filters):
|
|
16
|
+ return True
|
|
17
|
+
|
|
18
|
+ ## @brief insert
|
|
19
|
+ # @param typename string
|
|
20
|
+ # @param classname string
|
|
21
|
+ # @param **datas dict
|
|
22
|
+ def insert(self, typename, classname, **datas):
|
|
23
|
+ return True
|
|
24
|
+
|
|
25
|
+ ## @brief delete
|
|
26
|
+ # @param lodel_id (int) : list of lode_id(s) to delete
|
|
27
|
+ def delete(self, lodel_id):
|
|
28
|
+ return True
|
|
29
|
+
|
|
30
|
+ ## @brief search for a collection of objects
|
|
31
|
+ # @param emclass LeClass : LeClass instance
|
|
32
|
+ # @param emtype LeType : LeType instance
|
|
33
|
+ # @param field_list list : list of fields to get from the datasource
|
|
34
|
+ # @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
|
|
35
|
+ # @param relational_filters
|
|
36
|
+ def get(self, emclass, emtype, field_list, filters, relational_filters):
|
|
37
|
+ return {}
|
|
38
|
+
|