Attachment 'exchangecategory.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Action for exchanging the category of the page
4
5 @copyright: 2012 MoinMoin:ReimarBauer
6 @license: GNU GPL, see COPYING for details.
7 """
8
9 from MoinMoin.Page import Page
10 from MoinMoin.PageEditor import PageEditor
11
12 def execute(pagename, request):
13 if not request.user.may.read(pagename):
14 msg = "You are not allowed to view this page."
15 request.theme.add_msg(msg, "error")
16 Page(request, pagename).send_page()
17 else:
18 text = Page(request, pagename).get_raw_body()
19 '''
20 ADD here the code to replace the category
21 '''
22 msg = "Changed category foo to bar."
23 try:
24 PageEditor(request, pagename).saveText(text, 0)
25 except PageEditor.Unchanged:
26 msg = "You did not change the page content, not saved!"
27 request.theme.add_msg(msg, "info")
28 Page(request, pagename).send_page()
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.