parameters: ()
return_statement: return dict(form=form,page=page)
docstring: edit a page
docstring_summary: edit a page
docstring_tokens: edit a page
function: def page_edit():
      """
      edit a page
      """
      slug = request.args(0) or 'index'
      w = db.plugin_wiki_page
      w.role.writable = w.role.readable = plugin_wiki_level>1
      page = w(slug=slug)
      if not page:
          page = w.insert(slug=slug,
                          title=slug.replace('-',' ').capitalize(),
                          body=request.vars.template and w(slug=request.vars.template).body or '')
      form = crud.update(w, page, onaccept=crud.archive,
                         next=URL('page',args=request.args))
      return dict(form=form,page=page)
function_tokens: def page_edit ( ) : slug = request . args ( 0 ) or 'index' w = db . plugin_wiki_page w . role . writable = w . role . readable = plugin_wiki_level > 1 page = w ( slug = slug ) if not page : page = w . insert ( slug = slug , title = slug . replace ( '-' , ' ' ) . capitalize ( ) , body = request . vars . template and w ( slug = request . vars . template ) . body or '' ) form = crud . update ( w , page , onaccept = crud . archive , next = URL ( 'page' , args = request . args ) ) return dict ( form = form , page = page )