2 things
* that was written for 0.8* therefore you should expect somethings not to work.
* the idea behind wiki tutorial is show people the basic features of it therefore showing diferent ways of doing things is a good idea.

On 2/16/06, Damjan <[EMAIL PROTECTED]> wrote:

Also, about the wiki tutorial... I have a suggestion about the part on
clicking links to non-existing pages.

Instead of carying that magic "new" flag everywhere in edit.kid and in
the "save" method... the edit and save methods might reuse the try:
except SQLObjectNotFound: pattern already learned in the index method.

Like so:


    def save(self, pagename, data, **kwds):
        hub.begin()
        try:
            page = Page.byPagename (pagename)
            page.data = "">        except SQLObjectNotFound:
            page = Page(pagename=pagename, data="">        hub.commit()
        hub.end()
        turbogears.flash("Changes saved!")
        raise cherrypy.HTTPRedirect("/%s" % pagename)

    def edit(self, pagename):
        try:
            page = Page.byPagename(pagename)
        except SQLObjectNotFound:
            return dict(pagename=pagename, data=""
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to