comparison MoinMoin/action/supplementation.py @ 1743:00ffe1ab1c8b

supplementation: minor optimizations
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 14 Jan 2007 00:49:54 +0100
parents e9813bc43544
children 4a31739bc6e1
comparison
equal deleted inserted replaced
1742:7b419bd3b2cf 1743:00ffe1ab1c8b
1 # -*- coding: iso-8859-1 -*- 1 # -*- coding: iso-8859-1 -*-
2 """ 2 """
3 MoinMoin - Action for supplementation pages 3 MoinMoin - This Action is used to create a supplementation subpage e.g. a Discussion page below a comon page
4
5 This Action is used to create a supplementation subpage e.g. a Discussion page below a comon page
6 4
7 Note: 5 Note:
8 derived from the newpage macro by Vito Miliano (vito_moinnewpagewithtemplate@perilith.com) et al 6 derived from the newpage macro by Vito Miliano (vito_moinnewpagewithtemplate@perilith.com) et al
9 7
10 @copyright: 2006-2007 ReimarBauer 8 @copyright: 2006-2007 ReimarBauer
28 url = Page(request, newpagename).url(request, query, escape=0, relative=False) 26 url = Page(request, newpagename).url(request, query, escape=0, relative=False)
29 test = Page(request, newpagename) 27 test = Page(request, newpagename)
30 if test.exists(): # page is defined -> redirect 28 if test.exists(): # page is defined -> redirect
31 request.http_redirect(url) 29 request.http_redirect(url)
32 else: # page will be created from template 30 else: # page will be created from template
33 query = {'action': 'edit', 'backto': newpagename} 31 query = {'action': 'edit', 'backto': newpagename, 'template': quoteWikinameURL(sub_page_template)}
34 query['template'] = quoteWikinameURL(sub_page_template)
35 url = Page(request, newpagename).url(request, query, escape=0, relative=False) 32 url = Page(request, newpagename).url(request, query, escape=0, relative=False)
36 request.http_redirect(url) 33 request.http_redirect(url)