Package trac :: Package wiki :: Module model :: Class WikiPage

Class WikiPage

source code

object --+
         |
        WikiPage

Represents a wiki page (new or existing).
Instance Methods
 
__init__(self, env, name=None, version=None)
Create a new page object or retrieves an existing page.
source code
 
__repr__(self)
repr(x)
source code
 
delete(self, version=None)
Delete one or all versions of a page.
source code
 
save(self, author, comment, t=None, replace=False)
Save a new version of a page.
source code
 
rename(self, new_name)
Rename wiki page in-place, keeping the history intact.
source code
 
edit_comment(self, new_comment)
Edit comment of wiki page version in-place.
source code
 
get_history(self)
Retrieve the edit history of a wiki page.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  realm = 'wiki'
Properties
  resource
  exists

Inherited from object: __class__

Method Details

__init__(self, env, name=None, version=None)
(Constructor)

source code 
Create a new page object or retrieves an existing page.
Parameters:
  • env - an Environment object.
  • name - the page name or a Resource object.
  • version - the page version. The value takes precedence over the Resource version when both are specified.
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

rename(self, new_name)

source code 
Rename wiki page in-place, keeping the history intact. Renaming a page this way will eventually leave dangling references to the old page - which literally doesn't exist anymore.

get_history(self)

source code 
Retrieve the edit history of a wiki page.
Returns:
a tuple containing the version, datetime, author and comment.

Property Details

resource

Get Method:
unreachable.resource(self)

exists

Get Method:
unreachable(self)