details:   https://code.tryton.org/tryton/commit/7ef7833dc9a6
branch:    default
user:      Cédric Krier <[email protected]>
date:      Tue Oct 13 16:27:00 2026 +0200
description:
        Rename delete_many to deletemany in the FileStore
diffstat:

 trytond/CHANGELOG                       |  1 +
 trytond/doc/ref/filestore.rst           |  2 +-
 trytond/trytond/filestore.py            |  9 ++++++++-
 trytond/trytond/ir/filestore.py         |  2 +-
 trytond/trytond/tests/test_filestore.py |  4 ++--
 5 files changed, 13 insertions(+), 5 deletions(-)

diffs (76 lines):

diff -r 5009af787f74 -r 7ef7833dc9a6 trytond/CHANGELOG
--- a/trytond/CHANGELOG Wed Oct 28 17:01:46 2026 +0100
+++ b/trytond/CHANGELOG Tue Oct 13 16:27:00 2026 +0200
@@ -1,3 +1,4 @@
+* Rename delete_many to deletemany in the FileStore
 * Restrict the wizard session to the user who created it (issue15206)
 * Only permit administrators to execute wizards without models or groups 
(issue15205)
 
diff -r 5009af787f74 -r 7ef7833dc9a6 trytond/doc/ref/filestore.rst
--- a/trytond/doc/ref/filestore.rst     Wed Oct 28 17:01:46 2026 +0100
+++ b/trytond/doc/ref/filestore.rst     Tue Oct 13 16:27:00 2026 +0200
@@ -41,7 +41,7 @@
 
    Remove the data identified by ``id`` in the prefixed directory.
 
-.. method:: FileStore.delete_many(ids[, prefix])
+.. method:: FileStore.deletemany(ids[, prefix])
 
    Remove the sequence of data identified by the sequence of ``ids`` in the
    prefixed directory.
diff -r 5009af787f74 -r 7ef7833dc9a6 trytond/trytond/filestore.py
--- a/trytond/trytond/filestore.py      Wed Oct 28 17:01:46 2026 +0100
+++ b/trytond/trytond/filestore.py      Tue Oct 13 16:27:00 2026 +0200
@@ -3,6 +3,7 @@
 
 import os
 import uuid
+import warnings
 from functools import cache
 
 import trytond.config as config
@@ -72,10 +73,16 @@
         except FileNotFoundError:
             pass
 
-    def delete_many(self, ids, prefix=''):
+    def deletemany(self, ids, prefix=''):
         for id_ in ids:
             self.delete(id_, prefix)
 
+    def delete_many(self, *args, **kwargs):
+        warnings.warn(
+            'delete_many is deprecated, user deletemany',
+            DeprecationWarning)
+        return self.deletemany(*args, **kwargs)
+
 
 if config.get('database', 'class'):
     FileStore = resolve(config.get('database', 'class'))  # noqa: F811
diff -r 5009af787f74 -r 7ef7833dc9a6 trytond/trytond/ir/filestore.py
--- a/trytond/trytond/ir/filestore.py   Wed Oct 28 17:01:46 2026 +0100
+++ b/trytond/trytond/ir/filestore.py   Tue Oct 13 16:27:00 2026 +0200
@@ -78,4 +78,4 @@
             to_remove[prefix or ''].extend(deleted_ids - active_ids)
 
         for store_prefix, to_delete in to_remove.items():
-            filestore.delete_many(to_delete, prefix=store_prefix)
+            filestore.deletemany(to_delete, prefix=store_prefix)
diff -r 5009af787f74 -r 7ef7833dc9a6 trytond/trytond/tests/test_filestore.py
--- a/trytond/trytond/tests/test_filestore.py   Wed Oct 28 17:01:46 2026 +0100
+++ b/trytond/trytond/tests/test_filestore.py   Tue Oct 13 16:27:00 2026 +0200
@@ -80,12 +80,12 @@
         with self.assertRaises(IOError):
             filestore.get(id_, prefix='test')
 
-    def test_delete_many(self):
+    def test_deletemany(self):
         "Test multiple deletions"
         id1, id2, id3 = filestore.setmany(
             [self.data(), self.data(), self.data()],
             prefix='test')
-        filestore.delete_many([id1, id2], prefix='test')
+        filestore.deletemany([id1, id2], prefix='test')
 
         for id_ in [id1, id2]:
             with self.assertRaises(IOError):

Reply via email to