Wiki Actions

inyoka.wiki.actions

This module contains all the actions for the wiki. Actions are bound to a page and change the default display for a page. Per default the action is ‘show’ and displays the most recent revision or the revision provided in the URL. Other actions are ‘edit’, ‘delete’, ‘info’, ‘diff’ etc.

All actions are passed normalized page names because the view function that dispatches action ensures that. If however actions are called from a source that deals with user submitted data all page names must be normalized. The database models do not do this on their own!

copyright:
  1. 2007-2024 by the Inyoka Team, see AUTHORS for more details.

license:

BSD, see LICENSE for more details.

inyoka.wiki.actions._get_wiki_article_templates()

Return a list of template choices for use in NewArticleForm.

inyoka.wiki.actions._get_wiki_reserved_names()

Return a list of words that should not be used as article names.

inyoka.wiki.actions._rename(request, page, new_name, force=False, new_text=None)

Rename all revisions of page to new_name.

Return True if renaming was successful, else False

inyoka.wiki.actions.clean_article_name(view)

Decorator to clean pagenames as they are passed to the view functions.

inyoka.wiki.actions.context_modifier(request, context)

If a key called 'page' that points to a page object is part of the context this modifier will hook a PrivilegeTest for the current user and that page into the request (called can). Then the templates can test for privileges this way:

{% if can.read %}...{% endif %}
inyoka.wiki.actions.do_attach(request, *args, **kwargs)
inyoka.wiki.actions.do_attach_edit(request, *args, **kwargs)
inyoka.wiki.actions.do_create(request, *args, **kwargs)

Create a new wiki page.

inyoka.wiki.actions.do_delete(request, *args, **kwargs)
inyoka.wiki.actions.do_diff(request, *args, **kwargs)
inyoka.wiki.actions.do_edit(request, *args, **kwargs)
inyoka.wiki.actions.do_export(request, *args, **kwargs)
inyoka.wiki.actions.do_log(request, *args, **kwargs)
inyoka.wiki.actions.do_metaexport(request, *args, **kwargs)
inyoka.wiki.actions.do_missing_page(request, *args, **kwargs)

Called if a page does not exist yet but it was requested by show.

Template

'wiki/missing_page.html'

Context
page_name

The name of the page that does not exist.

title

The title of that page.

similar

List of pages with a similar name. The list contains some dicts with name and title items.

backlinks

Like similar but contains a list of pages that refer to this page with links.

inyoka.wiki.actions.do_mv_back(request, *args, **kwargs)
inyoka.wiki.actions.do_mv_baustelle(request, *args, **kwargs)
inyoka.wiki.actions.do_mv_discontinued(request, *args, **kwargs)
inyoka.wiki.actions.do_rename(request, *args, **kwargs)
inyoka.wiki.actions.do_revert(request, *args, **kwargs)
inyoka.wiki.actions.do_show(request, *args, **kwargs)
inyoka.wiki.actions.do_subscribe(request, *args, **kwargs)
inyoka.wiki.actions.do_unsubscribe(request, *args, **kwargs)