Mercurial > hg > MPIWGWeb
comparison MPIWGStaff.py @ 46:955d102392db
pubman integration 0.2
author | dwinter |
---|---|
date | Sat, 27 Apr 2013 10:04:57 +0200 |
parents | 3c98cc79dd14 |
children | 225179dfd892 |
comparison
equal
deleted
inserted
replaced
38:3c98cc79dd14 | 46:955d102392db |
---|---|
1118 tmp=[x for x in list] | 1118 tmp=[x for x in list] |
1119 tmp.sort(sort) | 1119 tmp.sort(sort) |
1120 | 1120 |
1121 return tmp | 1121 return tmp |
1122 | 1122 |
1123 def getPublications(self,memberID="renn"): | 1123 def getPublications(self,coneId="renn"): |
1124 | 1124 |
1125 logging.debug("coneID:%s"%coneId) | |
1125 try: | 1126 try: |
1126 pubs=self.mpiwgPubman.getPublications(memberID) | 1127 pubs=self.mpiwgPubman.getPublications(coneId) |
1128 | |
1127 return pubs | 1129 return pubs |
1128 except: | 1130 except: |
1129 return [] | 1131 return [] |
1130 def manage_addMPIWGStaffFolderForm(self): | 1132 def manage_addMPIWGStaffFolderForm(self): |
1131 """form for adding the project""" | 1133 """form for adding the project""" |
1162 | 1164 |
1163 def getUsername(self): | 1165 def getUsername(self): |
1164 """returns the username""" | 1166 """returns the username""" |
1165 id = re.sub('@mpiwg-berlin\.mpg\.de', '', self.content.e_mail) | 1167 id = re.sub('@mpiwg-berlin\.mpg\.de', '', self.content.e_mail) |
1166 return id | 1168 return id |
1169 | |
1170 def getConeId(self): | |
1171 """return cone ID""" | |
1172 results= self.folder.executeZSQL("SELECT coneid FROM keys WHERE key_main = %s",[self.content.key]) | |
1173 for res in results: | |
1174 return res.coneid | |
1175 return None | |
1167 | 1176 |
1168 def getPublishedImageUrl(self): | 1177 def getPublishedImageUrl(self): |
1169 """returns the URL to the image if it is published""" | 1178 """returns the URL to the image if it is published""" |
1170 if self.content.image_p == 'yes': | 1179 if self.content.image_p == 'yes': |
1171 url = 'http://digilib.mpiwg-berlin.mpg.de/digitallibrary/Scaler?fn=permanent/mpiwg/staff/%s'%self.getUsername() | 1180 url = 'http://digilib.mpiwg-berlin.mpg.de/digitallibrary/Scaler?fn=permanent/mpiwg/staff/%s'%self.getUsername() |
1554 splitted = ident.split("@"); | 1563 splitted = ident.split("@"); |
1555 return splitted[0] | 1564 return splitted[0] |
1556 | 1565 |
1557 def getPublications(self): | 1566 def getPublications(self): |
1558 | 1567 |
1559 pubs= self.folder.getPublications("") | 1568 coneId = self.getConeId(); |
1560 | 1569 if coneId: |
1561 return pubs | 1570 pubs= self.folder.getPublications(coneId) |
1571 return pubs | |
1572 return [] | |
1562 | 1573 |
1563 | 1574 |
1564 InitializeClass(MPIWGStaffMember) | 1575 InitializeClass(MPIWGStaffMember) |