use '@@' for providing links to views

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3684 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-01-14 12:11:54 +00:00
parent 7cfd9f011b
commit 50570a44f1
3 changed files with 7 additions and 5 deletions

View file

@ -83,7 +83,7 @@ should lead to a view that will create the page.
<p><a class="reference"
href="http://127.0.0.1/demo_wiki/start_page">Back to the Start Page</a></p>
<p><a class="reference create"
href="http://127.0.0.1/demo_wiki/create.html?name=more">?More...</a></p>
href="http://127.0.0.1/demo_wiki/&#64;&#64;create.html?name=more">?More...</a></p>
Again a link object has been created that will be reused for subsequent
rendering operations.
@ -94,7 +94,7 @@ rendering operations.
>>> print aboutPage.render(TestRequest())
<p>...
<p><a class="reference create"
href="http://127.0.0.1/demo_wiki/create.html?name=more">?More...</a></p>
href="http://127.0.0.1/demo_wiki/&#64;&#64;create.html?name=more">?More...</a></p>
>>> len(links)
2
@ -116,7 +116,7 @@ Links with fragments (anchor references) and parameters
<li><a class="reference"
href="http://127.0.0.1/demo_wiki/about#content?language=en">About content</a></li>
<li><a class="reference create"
href="http://127.0.0.1/demo_wiki/create.html?name=more#content?language=en">?More content</a></li>
href="http://127.0.0.1/demo_wiki/&#64;&#64;create.html?name=more#content?language=en">?More content</a></li>
</ul>
External links

View file

@ -72,7 +72,7 @@ class LinkProcessor(object):
if self.request is not None:
if target is None:
#uri = link.refuri = '%s/create.html?name=%s' % (
uri = '%s/create.html?name=%s' % (
uri = '%s/@@create.html?name=%s' % (
absoluteURL(wiki, self.request), link.name)
else:
uri = target.getURI(self.request)

View file

@ -122,11 +122,12 @@ class Wiki(BaseWiki):
def createPage(self, name, title, text=u''):
# TODO: delegate to generic folder
# page = self[name] = WikiPage(name)
# page = self[name] = self.pageFactory(name)
self._setObject(name, self.pageFactory(name))
page = getattr(self, name)
page.title = title
page.text = text
# TODO: notify(ObjectAddedEvent())
return page
def getManager(self):
@ -144,6 +145,7 @@ class WikiPage(BaseWikiPage):
def getWiki(self):
# TODO: fetch wiki in a generic way
# return self.getParent()
return aq_parent(aq_inner(self))