|
@@ -559,23 +559,9 @@ class LeDeleteQuery(LeFilteredQuery):
|
559
|
559
|
##@brief Implements delete query operations
|
560
|
560
|
# @returns the number of deleted items
|
561
|
561
|
# @exception when the number of deleted items is not as expected
|
562
|
|
- def __query(self):
|
563
|
|
- # select _uid corresponding to query_filter
|
564
|
|
- l_uids = self._datasource.select( self._target_class,
|
565
|
|
- list(self._target_class.getuid()),
|
566
|
|
- query_filter,
|
567
|
|
- None,
|
568
|
|
- None,
|
569
|
|
- None,
|
570
|
|
- None,
|
571
|
|
- 0,
|
572
|
|
- False)
|
573
|
|
- # list of dict l_uids : _uid(s) of the objects to be deleted
|
574
|
|
- nb_deleted = datasource.update(self._target_class,l_uids, **datas)
|
575
|
|
- if nb_deleted != len(l_uids):
|
576
|
|
- msg = "Number of deleted items %d is not as expected %d "
|
577
|
|
- msg %= (nb_deleted, len(l_uids))
|
578
|
|
- raise LeQueryError(msg)
|
|
562
|
+ def __query(self, filters, rel_filters):
|
|
563
|
+ nb_deleted = datasource.delete(
|
|
564
|
+ self._target_class, filters, rel_filters)
|
579
|
565
|
return nb_deleted
|
580
|
566
|
|
581
|
567
|
class LeGetQuery(LeFilteredQuery):
|