Mercurial > hg > MPIWGWeb
annotate MPIWGFeature.py @ 189:cc5198541af8
erzeugen neuer eintr?ge auf der homepage mittels updatexml
author | dwinter |
---|---|
date | Mon, 17 Jun 2013 13:48:55 +0200 |
parents | e0b343cee9dd |
children | dbc397782c76 |
rev | line source |
---|---|
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
1 from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
9 | 2 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
16 | 3 from OFS.Folder import Folder |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
4 from Globals import package_home |
16 | 5 |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
6 import os |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
7 import logging |
16 | 8 import datetime |
9 | |
137 | 10 from SrvTxtUtils import getDateString |
11 import MPIWGHelper | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
12 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
13 class MPIWGFeature(Folder): |
16 | 14 """special object for feature texts on the MPIWG website. |
15 Has templates for English and German in Folders /en/ and /de/. | |
16 Feature teaser is /(en|de)/teaser.pt. Full page is /(en|de)/main.pt. | |
17 Full title is the title of /(en|de)/main.pt. | |
18 """ | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
19 |
20 | 20 meta_type = "MPIWGFeature" |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
21 |
20 | 22 manage_options = Folder.manage_options + ( |
23 {'label':'Change Weight', 'action':'changeWeightForm'}, | |
24 {'label':'Configure', 'action':'changeForm'}, | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
25 ) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
26 |
84 | 27 # templates |
16 | 28 changeWeightForm = PageTemplateFile('zpt/feature/manage_change_weight', globals()) |
29 changeForm = PageTemplateFile('zpt/feature/manage_config', globals()) | |
84 | 30 feature_main = PageTemplateFile('zpt/feature/feature_template', globals()) |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
31 |
20 | 32 def __init__(self, id, title=None, weight=0, date=None, title_en=None, title_de=None, author=None, author_id=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
33 self.id = str(id) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
34 self.weight = weight |
20 | 35 self.author = author |
36 self.author_id = author_id | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
37 if title is None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
38 self.title = id |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
39 else: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
40 self.title = title |
16 | 41 |
42 if date is None: | |
43 self.date = datetime.date.today() | |
44 else: | |
45 self.date = date | |
46 | |
47 # | |
21 | 48 # add language folder and sample templates |
16 | 49 # |
50 mainid = 'main.pt' | |
51 teaserid = 'teaser.pt' | |
52 # english | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
53 self.manage_addFolder('en') |
16 | 54 folder_en = getattr(self, 'en') |
55 folder_en[teaserid] = ZopePageTemplate(teaserid) | |
20 | 56 teaser_en = getattr(folder_en, teaserid) |
57 teaser_en.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_teaser.zpt')).read(), 'text/html') | |
16 | 58 folder_en[mainid] = ZopePageTemplate(mainid) |
20 | 59 main_en = getattr(folder_en, mainid) |
60 main_en.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_main.zpt')).read(), 'text/html') | |
16 | 61 if title_en is not None: |
62 main_en.title = title_en | |
63 # german | |
64 self.manage_addFolder('de') | |
65 folder_de = getattr(self, 'de') | |
66 folder_de[teaserid] = ZopePageTemplate(teaserid) | |
20 | 67 teaser_de = getattr(folder_de, teaserid) |
68 teaser_de.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_teaser.zpt')).read(), 'text/html') | |
16 | 69 folder_de[mainid] = ZopePageTemplate(mainid) |
20 | 70 main_de = getattr(folder_de, mainid) |
71 main_de.pt_edit(open(os.path.join(package_home(globals()), 'zpt/feature/default_template_main.zpt')).read(), 'text/html') | |
16 | 72 if title_de is not None: |
73 main_de.title = title_de | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
74 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
75 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
76 def index_html(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
77 """default index page""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
78 return self.getMain() |
20 | 79 |
80 def getAuthor(self): | |
81 """returns the author name""" | |
82 return getattr(self, 'author', None) | |
83 | |
84 def getAuthorId(self): | |
85 """returns the author ID""" | |
86 return getattr(self, 'author_id', None) | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
87 |
16 | 88 def getFullTitle(self, lang=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
89 """returns the full title (from main.pt)""" |
16 | 90 if lang is None: |
91 # get Language from MPIWGRoot | |
92 lang = self.getLang() | |
93 | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
94 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
95 pt = getattr(dir, 'main.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
96 t = pt.title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
97 if not t: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
98 t = self.title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
99 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
100 return t |
5 | 101 |
16 | 102 def getDate(self): |
103 """returns the date as a date object""" | |
104 return getattr(self, 'date', None) | |
105 | |
106 def getDateString(self, lang=None): | |
107 """returns the date as a string""" | |
108 d = self.getDate() | |
109 if d is None: | |
110 return '???' | |
111 | |
112 if lang is None: | |
113 # get Language from MPIWGRoot | |
114 lang = self.getLang() | |
115 | |
137 | 116 return getDateString(date=d, lang=lang, withYear=True) |
16 | 117 |
5 | 118 |
137 | 119 getUrl = MPIWGHelper.getUrl |
120 | |
5 | 121 |
122 def getPath(self, page, relative=True): | |
123 """returns path to template page""" | |
124 # get Language from MPIWGRoot | |
125 lang = self.getLang() | |
126 dir = getattr(self, lang, self.en) | |
127 if relative: | |
20 | 128 return '%s/%s/%s' % (self.getId(), dir.getId(), page) |
5 | 129 |
18
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
130 pt = getattr(dir, page, None) |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
131 if pt is not None: |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
132 return pt.absolute_url_path() |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
133 |
3913a1c5c583
feature's getPath returns None if it can't find the template.
casties
parents:
17
diff
changeset
|
134 return None |
5 | 135 |
136 def getTeaserPath(self): | |
137 """returns the path to the teaser template""" | |
138 return self.getPath('teaser.pt') | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
139 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
140 def getIntro(self, **args): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
141 """returns the intro as PageTemplate""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
142 # get Language from MPIWGRoot |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
143 lang = self.getLang() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
144 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
145 pt = getattr(dir, 'intro.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
146 return pt(**args) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
147 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
148 def getMain(self, **args): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
149 """returns the main part as PageTemplate""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
150 # get Language from MPIWGRoot |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
151 lang = self.getLang() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
152 dir = getattr(self, lang, self.en) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
153 pt = getattr(dir, 'main.pt') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
154 return pt(**args) |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
155 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
156 def getFrontpageImg(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
157 """returns the image object for the frontpage""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
158 img = getattr(self, 'img-frontpage.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
159 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
160 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
161 def getFrontpageImgUrl(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
162 """returns the URL of the image object for the frontpage""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
163 img = getattr(self, 'img-frontpage.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
164 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
165 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
166 def getFrontpageThumb(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
167 """returns the image object for the frontpage thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
168 img = getattr(self, 'img-frontthumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
169 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
170 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
171 def getFrontpageThumbUrl(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
172 """returns the URL of the image object for the frontpage thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
173 img = getattr(self, 'img-frontthumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
174 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
175 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
176 def getThumbImg(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
177 """returns the image object for the sidebar thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
178 img = getattr(self, 'img-thumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
179 return img |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
180 |
84 | 181 def getThumbUrl(self): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
182 """returns the URL of the image object for the sidebar thumbnail""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
183 img = getattr(self, 'img-thumb.jpg') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
184 return img.absolute_url() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
185 |
20 | 186 def changeWeight(self, weight, RESPONSE=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
187 """change weight""" |
20 | 188 self.weight = weight |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
189 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
190 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
191 |
20 | 192 def changeMPIWGFeature(self, title=None, weight=None, date=None, title_en=None, title_de=None, |
193 author=None, author_id=None, RESPONSE=None): | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
194 """change everything""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
195 if title is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
196 self.title = title |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
197 if weight is not None: |
16 | 198 self.weight = weight |
20 | 199 if author is not None: |
200 self.author = author | |
201 if author_id is not None: | |
202 self.author_id = author_id | |
16 | 203 if date is not None: |
204 try: | |
205 self.date = datetime.datetime.strptime(date, '%Y-%m-%d').date() | |
206 except: | |
207 pass | |
208 | |
209 folder_en = self.get('en', None) | |
210 if folder_en is not None: | |
211 main_en = folder_en.get('main.pt', None) | |
212 if main_en is not None and title_en is not None: | |
213 main_en.title = title_en | |
214 | |
215 folder_de = self.get('de', None) | |
216 if folder_de is not None: | |
217 main_de = folder_de.get('main.pt', None) | |
218 if main_de is not None and title_de is not None: | |
219 main_de.title = title_de | |
220 | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
221 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
222 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
223 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
224 def getBreadcrumbs(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
225 """return list of breadcrumbs from here to the root""" |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
226 crumbs = [(self.getFullTitle(), self.absolute_url(), self)] |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
227 parent = self.aq_parent |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
228 if hasattr(parent, 'getBreadcrumbs'): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
229 if self.title: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
230 return parent.getBreadcrumbs() + crumbs |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
231 else: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
232 # if there's no title, skip this level |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
233 return parent.getBreadcrumbs() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
234 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
235 return crumbs |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
236 |
137 | 237 getSection = MPIWGHelper.getSection |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
238 |
137 | 239 getSubSection = MPIWGHelper.getSubSection |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
240 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
241 |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
242 def manage_addMPIWGFeatureForm(self): |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
243 """Form for adding""" |
20 | 244 pt = PageTemplateFile(os.path.join(package_home(globals()), 'zpt/feature/manage_add_MPIWGFeature.zpt')).__of__(self) |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
245 return pt() |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
246 |
20 | 247 def manage_addMPIWGFeature(self, id, title=None, weight=0, title_en=None, title_de=None, author=None, author_id=None, RESPONSE=None): |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
248 "Add a MPIWG Feature object" |
20 | 249 newObj = MPIWGFeature(id, title=title, weight=weight, title_en=title_en, title_de=title_de, author=author, author_id=author_id) |
250 self.Destination()._setObject(id, newObj) | |
0
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
251 if RESPONSE is not None: |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
252 RESPONSE.redirect('manage_main') |
bca61e893fcc
first checkin of MPIWGWeb r2 branch from CVS into mercurial
casties
parents:
diff
changeset
|
253 |