This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
The following commit(s) were added to refs/heads/master by this push:
new 4a7f05e Adds method to fetch multiple troves by their IDs
4a7f05e is described below
commit 4a7f05e78ef26cf3ba49e8deb4f3f006ff30d2b4
Author: Kenton Taylor <[email protected]>
AuthorDate: Tue Dec 7 16:06:34 2021 +0000
Adds method to fetch multiple troves by their IDs
---
Allura/allura/model/project.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 1ef6973..1c2afe3 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -175,6 +175,10 @@ class TroveCategory(MappedClass):
'remove first section of full path, and use nicer separator'
return ' ยป '.join(self.fullpath.split(' :: ')[1:])
+ @classmethod
+ def by_trove_cat_ids(cls, *ids):
+ return cls.query.find({'trove_cat_id': {'$in': ids}}).all()
+
def __json__(self):
return dict(
id=self.trove_cat_id,