Mercurial > hg > MPIWGWeb
comparison MPIWGProjects.py @ 156:a9ad7dd7a8b2
clean up projects.
author | casties |
---|---|
date | Wed, 05 Jun 2013 13:12:42 +0200 |
parents | 4a8a532a05ba |
children | 47392bf3fcba |
comparison
equal
deleted
inserted
replaced
155:9e7bc0958fd8 | 156:a9ad7dd7a8b2 |
---|---|
1829 | 1829 |
1830 | 1830 |
1831 | 1831 |
1832 def manage_addMPIWGProjectForm(self): | 1832 def manage_addMPIWGProjectForm(self): |
1833 """form for adding the project""" | 1833 """form for adding the project""" |
1834 pt = PageTemplateFile(os.path.join(package_home(globals()), 'zpt', 'addMPIWGProjectForm.zpt')).__of__(self) | 1834 pt = PageTemplateFile('zpt/project/manage_add_MPIWGProject', globals()).__of__(self) |
1835 return pt() | 1835 return pt() |
1836 | 1836 |
1837 def manage_addMPIWGProject(self, id, RESPONSE=None): | 1837 def manage_addMPIWGProject(self, id, fileupload=None, RESPONSE=None): |
1838 """method to add a project""" | 1838 """method to add a project""" |
1839 # print argv | |
1840 fileupload = self.REQUEST.get('fileupload', None) | |
1841 if fileupload: | 1839 if fileupload: |
1842 | |
1843 file_name = fileupload.filename | |
1844 filedata = fileupload.read() | 1840 filedata = fileupload.read() |
1845 | |
1846 argv = xmlhelper.proj2hash(filedata) | 1841 argv = xmlhelper.proj2hash(filedata) |
1847 | |
1848 # print argv | 1842 # print argv |
1849 newObj = MPIWGProject(id, argv) | 1843 newObj = MPIWGProject(id, argv) |
1844 | |
1850 else: | 1845 else: |
1851 newObj = MPIWGProject(id) | 1846 newObj = MPIWGProject(id) |
1852 | 1847 |
1853 self._setObject(id, newObj) | 1848 self._setObject(id, newObj) |
1854 | 1849 |
1855 if RESPONSE is not None: | 1850 if RESPONSE is not None: |
1856 RESPONSE.redirect('manage_main') | 1851 url = '%s/%s/editBasic'%(self.absolute_url(), id) |
1852 RESPONSE.redirect(url) | |
1857 | 1853 |
1858 | 1854 |
1859 class MPIWGProjectFolder(ZDBInterfaceFolder): | 1855 class MPIWGProjectFolder(ZDBInterfaceFolder): |
1860 """Folder of project objects""" | 1856 """Folder of project objects""" |
1861 | 1857 |