Mercurial > hg > MPIWGWeb
comparison MPIWGDepartment.py @ 24:6a4996805505
more work on projects.
author | casties |
---|---|
date | Tue, 09 Apr 2013 16:50:29 +0200 |
parents | 54f135c1ed65 |
children | 9a75eb1b31b3 |
comparison
equal
deleted
inserted
replaced
23:3825a9e17409 | 24:6a4996805505 |
---|---|
134 def getThumbImgUrl(self): | 134 def getThumbImgUrl(self): |
135 """returns the URL of the image object for the sidebar thumbnail""" | 135 """returns the URL of the image object for the sidebar thumbnail""" |
136 img = getattr(self, 'img-thumb.jpg') | 136 img = getattr(self, 'img-thumb.jpg') |
137 return img.absolute_url() | 137 return img.absolute_url() |
138 | 138 |
139 def getProjects(self, onlyActive=0, onlyArchived=0): | |
140 """returns a list of projects of this department. | |
141 | |
142 onlyActive = 0 : all projects | |
143 onlyActive = 1 : active projects | |
144 onlyActive = 2 : inactive projects | |
145 | |
146 onlyArchived = 0 : all projects | |
147 onlyArchived = 1 : current projects | |
148 onlyArchived = 2 : archived projects | |
149 """ | |
150 # getTree: jeder Eintrag ist ein Tupel (Tiefe, ProjektNummer,Titel,ProjektObject) | |
151 tree = self.getTree(dep=self.getProjectId(), date=None, onlyActive=onlyActive, onlyArchived=onlyArchived) | |
152 # re-pack into simple list | |
153 projects = [] | |
154 for item in tree: | |
155 projects.append(item[3]) | |
156 | |
157 return projects | |
158 | |
139 def changeWeight(self,weight,RESPONSE=None): | 159 def changeWeight(self,weight,RESPONSE=None): |
140 """change weight""" | 160 """change weight""" |
141 self.weight=weight | 161 self.weight=weight |
142 if RESPONSE is not None: | 162 if RESPONSE is not None: |
143 RESPONSE.redirect('manage_main') | 163 RESPONSE.redirect('manage_main') |