[open-ils-commits] r8475 - trunk/Open-ILS/src/python/oils
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jan 23 09:23:36 EST 2008
Author: erickson
Date: 2008-01-23 08:57:00 -0500 (Wed, 23 Jan 2008)
New Revision: 8475
Modified:
trunk/Open-ILS/src/python/oils/org.py
Log:
added method to return flat list of related orgs
Modified: trunk/Open-ILS/src/python/oils/org.py
===================================================================
--- trunk/Open-ILS/src/python/oils/org.py 2008-01-23 13:31:36 UTC (rev 8474)
+++ trunk/Open-ILS/src/python/oils/org.py 2008-01-23 13:57:00 UTC (rev 8475)
@@ -88,6 +88,18 @@
return root
@staticmethod
+ def get_related_list(org_unit):
+ ''' Returns a flat list of related org_units '''
+ tree = OrgUtil.get_related_tree(org_unit)
+ orglist = []
+ def flatten(node):
+ orglist.append(node)
+ for child in node.children():
+ flatten(child)
+ flatten(tree)
+ return orglist
+
+ @staticmethod
def debug_org(org_unit, indent=0):
''' Simple function to print the tree of orgs provided '''
import sys
More information about the open-ils-commits
mailing list