Mercurial > hg > MPIWGWeb
comparison MPIWGRoot_deleted_methods.py @ 52:1ed79b33200c
more work on projects and cleanup.
| author | casties |
|---|---|
| date | Tue, 30 Apr 2013 16:00:56 +0200 |
| parents | d456fe185649 |
| children | dc41deabc8f8 |
comparison
equal
deleted
inserted
replaced
| 51:d456fe185649 | 52:1ed79b33200c |
|---|---|
| 810 if date: | 810 if date: |
| 811 txt="""<h2>Auf dieser Seite finden Sie die Projekte mit Stand vom %s</h2>"""%str(date) | 811 txt="""<h2>Auf dieser Seite finden Sie die Projekte mit Stand vom %s</h2>"""%str(date) |
| 812 return "" | 812 return "" |
| 813 | 813 |
| 814 | 814 |
| 815 def getContexts(self,childs=None,parents=None,depth=None,date=None,onlyActive=True): | |
| 816 """childs alle childs, alle parents""" | |
| 817 ret=[] | |
| 818 | |
| 819 if parents: | |
| 820 pnums=parents.split(".") | |
| 821 while len(pnums) > 1: | |
| 822 pnums.pop() | |
| 823 parentId=string.join(pnums,".") | |
| 824 | |
| 825 for project in self.getProjectFields('xdata_05',sort='int',date=date): | |
| 826 if project[1]==parentId: | |
| 827 ret.append(project) | |
| 828 | |
| 829 if (depth is not None) and (len(ret) >= depth): | |
| 830 break | |
| 831 | |
| 832 if childs: | |
| 833 for project in self.getProjectFields('xdata_05',sort='int',date=date): | |
| 834 searchStr=childs+"(\..*)" | |
| 835 | |
| 836 if (onlyActive and project[0].isActiveProject()) or (not onlyActive): | |
| 837 if re.match(searchStr,project[1]): | |
| 838 | |
| 839 if depth: | |
| 840 | |
| 841 if int(depth)>=len(project[1].split("."))-len(childs.split(".")): | |
| 842 | |
| 843 ret.append(project) | |
| 844 else: | |
| 845 ret.append(project) | |
| 846 | |
| 847 #logging.debug("getContexts: childs=%s parents=%s depth=%s => %s"%(childs,parents,depth,repr(ret))) | |
| 848 | |
| 849 return ret | |
| 850 | |
| 851 | |
| 815 | 852 |
