Browse Source

Coorecting error by passing cls to query

prieto 8 years ago
parent
commit
45f09240f7
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      lodel/leapi/leobject.py

+ 6
- 6
lodel/leapi/leobject.py View File

@@ -478,7 +478,7 @@ raised when trying to import Datasource"
478 478
     # @return a new uid en case of success, False otherwise
479 479
     @classmethod
480 480
     def insert(cls, datas):
481
-        query = LeInsertQuery(cls.__name__)
481
+        query = LeInsertQuery(cls)
482 482
         return query.execute(datas)
483 483
 
484 484
     ## @brief Update an instance of LeObject
@@ -492,7 +492,7 @@ raised when trying to import Datasource"
492 492
             query_filter.append((uid, '=', self.data(uid)))
493 493
         
494 494
         try:
495
-            query = LeUpdateQuery(cls.__name__, query_filter)
495
+            query = LeUpdateQuery(cls, query_filter)
496 496
         except Exception as err:
497 497
             raise err
498 498
             
@@ -511,7 +511,7 @@ raised when trying to import Datasource"
511 511
         query_filter = list()
512 512
         for uid in uids:
513 513
             query_filter.append((uid, '=', self.data(uid)))
514
-        query = LeDeleteQuery(cls.__name__, query_filter)
514
+        query = LeDeleteQuery(cls, query_filter)
515 515
         try:
516 516
             result = query.execute()
517 517
         except LeQueryError as err:
@@ -526,7 +526,7 @@ raised when trying to import Datasource"
526 526
     def delete_bundle(cls, query_filters):
527 527
         deleted = 0
528 528
         try:
529
-            query = LeDeleteQuery(cls.__name__, query_filters)
529
+            query = LeDeleteQuery(cls, query_filters)
530 530
         except Exception as err:
531 531
             raise err
532 532
                 
@@ -565,7 +565,7 @@ raised when trying to import Datasource"
565 565
                 query_filter.append((uids, '=', uid_tuples))
566 566
             else:
567 567
                 raise AttributeError("n %s:load :%s not a valid value for %s" % (uid_tuples, uids))
568
-        query = LeGetQuery(cls.__name__, query_filter, limit = 1)
568
+        query = LeGetQuery(cls, query_filter, limit = 1)
569 569
         try:
570 570
             result=query.execute()
571 571
         except LeQueryError as err:
@@ -598,7 +598,7 @@ raised when trying to import Datasource"
598 598
                 raise AttributeError("In %s:get : Cannot instanciate a LeObject without it's identifier" % cls.__name__)
599 599
 
600 600
         try:
601
-            query = LeGetQuery(cls.__name__, query_filter, field_list = field_list, order = order, group = group, limit = limit, offset = offset)
601
+            query = LeGetQuery(cls, query_filter, field_list = field_list, order = order, group = group, limit = limit, offset = offset)
602 602
         except ValueError as err:
603 603
             raise err
604 604
             

Loading…
Cancel
Save