Since you're about to make changes Mark, the notes below won't be
useful in future so I've put them here rather than a new topic. Please
feel free to use only the bits you wish to.

I've also removed four of the duplicated messages above.

Tony


==============================
The TurboGears 2 Wiki Tutorial
==============================
These notes refer to the web page::

  http://www.turbogears.org/2.0/docs/main/Wiki20/wiki20.html
  The top line of the page says:
  TurboGears--1.9.7 / The TurboGears 2 Wiki Tutorial      previous |
next | modules | index
  The bottom line of the page says:
    Last updated on Aug 29, 2008

Although some of the comments below refer to changes required to make
things work, some of them are extra notes and my own opinions. I also
feel it is useful to always mention new imports. The code changes are
usually obvious. Although this may be a little simplistic, we are
dealing with brand new users here, so maybe it's appropriate. Feel
free to comment or change anything.

Please note these notes do not cover installation issues. Installation
worked fine with no problems for me.

Setup
=====
6. -- Add (to explain the use for 2 shells)::

  One shell can be used to run and monitor the server, the second for
general shell use.

Quickstart
==========
To close down the web server, just use control-C (linux) or ???.

Controller and View
===================
No additions.

Controller Code
===============
The ``flash()`` function appears to have already been removed from the
whole of the code.

Displaying the Page
===================
The ``xi:`` namespace from w3.org is also used for includes.

Wiki Model and Database
=======================
Note that ``Page`` is the class name and ``page.py`` is the file name.

Database Configuration
======================
We don't make any changes to ``development.ini``

Initializing the Tables
=======================
The ``initializeDB.py`` script will not run as is, due to a conflict
with some zope code.

Add an extra import::

  import transaction

and change the commit from::

  DBSession.commit()

to::

  transaction.commit()

Incidentally, all uses of ``DBSession.commit()`` in the rest of the
tutorial should also be removed as the ``commit()`` is done
automatically by TurboGears now.

Adding Controllers
==================
You will get errors here when running the scripts if you do not have a
valid database with the relevant record for ``FrontPage`` already
created in it. It is not sufficient for the size of the database to be
nonzero. Use ``$ sqlite3 devdata.db`` then ``sqlite> select * from
pages;`` for further checks. See http://www.sqlite.org/sqlite.html

Adding Views (Templates)
========================
References to ``master.html`` seems to be a little irrelevant here
unless they are *all* listed.

Editing pages
=============
No additions.

Saving our edits
================
The ``DBSession.commit()`` function should no longer be used. It will
generate zope errors as the ``commit()`` is now done automatically by
TurboGears. Neither is flush() required to be used.

What about WikiWords?
=====================
We need an additional ``import tg`` for the url (although ``from tg
import url`` is more consistent with the rest of the code, provided
``tg.url()`` is edited in the method).

In the line::

  wikiwords = re.compile(r"\\b([A-Z]\\w+[A-Z]+\\w+)")

since we have used the r"..." operator we don't need the double
backslashes. One of each backslash pair should be removed throughout
the rest of the code examples.

This also applies in the ``re`` replacement within the ``default()``
method.

When editing the page text in the wiki from now on, we are of course
entering reStructuredText, for example paragraphs must be separated by
a blank line. see::

  http://docutils.sourceforge.net/docs/user/rst/quickref.html

The XML() function is not simply stripping off the XML, it is being
processed into a form that the browser can use. Presumably the output
of ``process_parts`` is XML not just HTML.

Hey, where’s the page?
======================
We need a new import here::

  from sqlalchemy.exceptions import InvalidRequestError

Adding a page list
==================
No additions.

Further Exploration
===================
Don't use the "mailing list" use the "TurboGears discussion list".
<<link as at top of this web page>>





On Oct 6, 4:14 pm, "Mark Ramm" <[EMAIL PROTECTED]> wrote:
> Sure, send it here.   There was a problem with the way we are storing
> the tutorial code and it needs to be cleaned up, but that is a task on
> my todo list for tomorrow, so anything that you can send in between
> now and then should be addressed then.
>
> --Mark Ramm
>
>
>
> On Mon, Oct 6, 2008 at 9:05 AM, tonyf <[EMAIL PROTECTED]> wrote:
>
> > Apologies - I'm not really trying to take over the thread by sending
> > things five times!
>
> > I guess it had something to do with being my first post, and being
> > moderated over the weekend. If I did something wrong could someone
> > please enlighten me!
>
> > Incidentally I have a (not very short) list of all the issues I had
> > with the tutorial. Would it be useful to post it in a new thread here,
> > or is there somewhere else to put it, for others to refer to. Most
> > things seem to have been mentioned somewhere in the forums, but are
> > also mixed up with out of date material and installation issues.
>
> > Sorry again
>
> > Tony   (and I hope you only get this once)
>
> > On Oct 4, 6:37 pm, tonyf <[EMAIL PROTECTED]> wrote:
> >> On Oct 3, 2:51 am, Gerry <[EMAIL PROTECTED]> wrote:
>
> >> > Hi Mark,
>
> >> > > And in the little database loading script you can just do import
> >> > > transaction/transaction.commit()
>
> >> > Can you give an example import?
>
> >> > Thanks,
>
> >> > Gerry.
>
> >> I got this to work as follows
>
> >> Add "import transaction"  near the top.
>
> >> Change "DBSession.commit()" to "transaction.commit()" at the bottom
>
> >> Tony
>
> --
> Mark Ramm-Christensen
> email: mark at compoundthinking dot com
> blog:www.compoundthinking.com/blog
--~--~---------~--~----~------------~-------~--~----~
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