Hi,

I'm new to TurboGears and new to Google groups but I'd like to suggest
some fixes for the Wiki 20 tutotrial.

First of all it seems that the fixes suggested by Rodney Haynie on
this list back in April 2009 haven't been incorporated yet.

I don't seem to be able to reply to his message so I'll just copy his
message at the bottom of this message.

Furthermore I noticed that on my Fedora system I need python-tg-
devtools for the paster quickstart to work.

quickstart now also prompts about mako templates.

Next I receive the following depreciation warning when starting the
server:
/usr/lib/python2.6/site-packages/pylons/templating.py:328:
DeprecationWarning: pylons.h is deprecated: use your project's
lib.helpers module directly instead. Your lib/helpers.py may require
the following additional imports:

    from pylons.helpers import log
    from pylons.i18n import get_lang, set_lang

Use the following in your project's lib/base.py file (and any other
module that
uses h):

    import MYPROJ.lib.helpers as h

(where MYPROJ is the name of your project) instead of:

    from pylons import h

  globs.update(pylons_globals())

The "Wiki Model and Database" section says to import Page and
pages_table from wiki20.model.page but pages_table is not defined.
I suspect that the "order_by(pagelist)" issue is also a result from
this.  Perhaps an earlier or more complicated version of this tutorial
contained an additional table.

Also "Wiki-20/wiki20/websetup.py" is a package named websetup in
version 2.1-0.1.b2.fc13.
After adding the code to initialize the table to wiki20/websetup/
schema.py the DB was created correctly.

I believe this section should be moved up so that the model is defined
before Wiki-20/wiki20/model/__init__.py is edited.  On my system the
server crashed when it tried to import the non-existing class.

Regards

Bram Mertens

---------- Forwarded message ----------
From: Rodney Haynie <[email protected]>
Date: Apr 11 2009, 2:51 pm
Subject: Suggestions for a couple Wiki 20 Tutorial fixes
To: TurboGears


I was going back through the Wiki 20 tutorial and found a couple quick
fixes I believe necessary.

Using TG2 RC1...

1. Under the heading "Hey, where’s the page?"

            raise tg.redirect("notfound", pagename = pagename)

tg was never imported, so...

Should be changed to:
            raise redirect("notfound", pagename = pagename)

2. Under the heading "Hey, where’s the page?"

    @expose("wiki20.templates.pagelist")
    defpagelist(self):
        pages = [page.pagename for page in
DBSession.query(Page).order_by(pagelist)]
        return dict(pages=pages)

Should be changed to:
        pages = [page.pagename for page in
DBSession.query(Page).order_by(Page.pagename)]

OR

        pages = [page.pagename for page in
DBSession.query(Page).order_by('pagename')]

Still new to TG2, so take my suggestions like a grain of salt.  :)

Rodney

-- 
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?hl=en.

Reply via email to