Browse Source

[#61] Corrected the headers of update and delete methods in dummy datasource

Roland Haroutiounian 9 years ago
parent
commit
e064173359
2 changed files with 5 additions and 6 deletions
  1. 4
    6
      leobject/datasources/dummy.py
  2. 1
    0
      leobject/datasources/ledatasourcesql.py

+ 4
- 6
leobject/datasources/dummy.py View File

15
     ## @brief update an existing LeObject
15
     ## @brief update an existing LeObject
16
     # @param lodel_id (int) : list of lodel_id
16
     # @param lodel_id (int) : list of lodel_id
17
     # @param checked_data dict
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)
18
+    def update(self, lodel_id, checked_data):
19
+        print ("DummyDatasource.update: ", lodel_id, checked_data)
21
         return True
20
         return True
22
 
21
 
23
     ## @brief create a new LeObject
22
     ## @brief create a new LeObject
31
 
30
 
32
     ## @brief delete an existing LeObject
31
     ## @brief delete an existing LeObject
33
     # @param lodel_id int | (int): lodel_id of the object(s) to delete
32
     # @param lodel_id int | (int): lodel_id of the object(s) to delete
34
-    # @param delete_filters string | (string): list of string of delete filters
35
     # @return okay bool: True on success, it will raise on failure
33
     # @return okay bool: True on success, it will raise on failure
36
-    def delete(self, lodel_id, delete_filters=None):
37
-        print("DummyDatasource.delete: ", lodel_id, delete_filters)
34
+    def delete(self, lodel_id):
35
+        print("DummyDatasource.delete: ", lodel_id)
38
         return True
36
         return True
39
 
37
 
40
     ## @brief search for a collection of objects
38
     ## @brief search for a collection of objects

+ 1
- 0
leobject/datasources/ledatasourcesql.py View File

21
     def get(self, emclass, emtype, field_list, filters, relational_filters):
21
     def get(self, emclass, emtype, field_list, filters, relational_filters):
22
         tablename =  emclass.name
22
         tablename =  emclass.name
23
         where_filters = self._prepare_filters(filters)
23
         where_filters = self._prepare_filters(filters)
24
+        rel_filters = self._prepare_filters(relational_filters)
24
         query = select(tablename, where=where_filters, select=field_list)
25
         query = select(tablename, where=where_filters, select=field_list)
25
         self.db.execute(query)
26
         self.db.execute(query)
26
         return all_to_dicts(self.db)
27
         return all_to_dicts(self.db)

Loading…
Cancel
Save