Mercurial > hg > MPIWGWeb
comparison MPIWGHelper.py @ 81:975a8d88e315
new editable info blocks for projects.
removed RelatedDigitalSources. updateAllProjects converts to info block.
author | casties |
---|---|
date | Fri, 10 May 2013 17:32:53 +0200 |
parents | b1893c4c9d2c |
children | ee79f6ba8d01 |
comparison
equal
deleted
inserted
replaced
80:b1893c4c9d2c | 81:975a8d88e315 |
---|---|
1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile | 1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
2 | 2 |
3 import SrvTxtUtils | 3 import SrvTxtUtils |
4 import time | |
5 import email | |
4 import logging | 6 import logging |
5 | |
6 definedFields=['WEB_title','xdata_01','xdata_02','xdata_03','xdata_04','xdata_05','xdata_06','xdata_07','xdata_08','xdata_09','xdata_10','xdata_11','xdata_12','xdata_13','WEB_project_header','WEB_project_description','WEB_related_pub'] | |
7 | |
8 checkFields = ['xdata_01'] | |
9 | 7 |
10 #ersetzt logging | 8 #ersetzt logging |
11 def logger(txt,method,txt2): | 9 def logger(txt,method,txt2): |
12 """logging""" | 10 """logging""" |
13 logging.info(txt+ txt2) | 11 logging.info(txt+ txt2) |
154 if baseUrl is None: | 152 if baseUrl is None: |
155 return self.absolute_url() | 153 return self.absolute_url() |
156 | 154 |
157 return '%s/%s' % (baseUrl, self.getId()) | 155 return '%s/%s' % (baseUrl, self.getId()) |
158 | 156 |
157 | |
158 def redirect(self, RESPONSE, url): | |
159 """mache ein redirect mit einem angehaengten time stamp um ein reload zu erzwingen""" | |
160 timeStamp = time.time() | |
161 | |
162 if url.find("?") > -1: # giebt es schon parameter | |
163 addStr = "&time=%s" | |
164 else: | |
165 addStr = "?time=%s" | |
166 | |
167 RESPONSE.setHeader('Last-Modified', email.Utils.formatdate().split("-")[0] + 'GMT') | |
168 logging.debug(email.Utils.formatdate() + ' GMT') | |
169 RESPONSE.redirect(url + addStr % timeStamp) | |
170 | |
171 |