Browse Source

[#61] Added the case of a non given relational_filters argument

Roland Haroutiounian 9 years ago
parent
commit
d826611811
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      leobject/datasources/ledatasourcesql.py

+ 4
- 2
leobject/datasources/ledatasourcesql.py View File

@@ -42,13 +42,15 @@ class LeDataSourceSQL(DummyDatasource):
42 42
     # @param emtype
43 43
     # @param filters list : list of tuples formatted as (FIELD, OPERATOR, VALUE)
44 44
     # @param relational_filters
45
-    def get(self, emclass, emtype, field_list, filters, relational_filters):
45
+    def get(self, emclass, emtype, field_list, filters, relational_filters=None):
46 46
 
47 47
         tablename =  emclass.name
48 48
         where_filters = self._prepare_filters(filters)
49
-        rel_filters = self._prepare_filters(relational_filters)
49
+        if relational_filters or len(relational_filters) > 0:
50
+            rel_filters = self._prepare_filters(relational_filters)
50 51
         query = select(tablename, where=where_filters, select=field_list)
51 52
         self.db.execute(query)
53
+
52 54
         return all_to_dicts(self.db)
53 55
 
54 56
     # @brief prepares the filters to be used by the mosql library's functions

Loading…
Cancel
Save