Here's a short-term hack to make this work without removing
"master.kid" from the templates:

In view.py:

Add the following two lines below the "sitetemplate = None" statement
(line 22):

mastertemplate = None
master_template_found = False

Add the corresponding global statements below "global sitetemplate"
(around line 43):

    global mastertemplate
    global master_template_found

Add this code after the body of the if statement ("if not loadingSite
and not sitetemplate") found near line 47:

    if not master_template_found:
        master_template_found = True
        master_template_source = "turbogears.fastdata.templates.master"
        lookupTemplate(master_template_source)
        sys.modules["mastertemplate"] =
sys.modules[master_template_source]
        mastertemplate = sys.modules["mastertemplate"]

This if statement is necessary because without it, the code will error
out with a RuntimeException ("RuntimeError: maximum recursion depth
exceeded").

Now, in each of the fastdata kid templates (form.kid, item.kid, and
list.kid), replace the old header:

<html xmlns="http://www.w3.org/1999/xhtml";
xmlns:py="http://purl.org/kid/ns#";
py:extends="'master.kid'">

with a new one:

<?python import mastertemplate ?>
<html xmlns="http://www.w3.org/1999/xhtml";
xmlns:py="http://purl.org/kid/ns#";
    py:extends="mastertemplate">

That should make the wiki20 example work with the DataController code.
If you want to use the toolbox, you'll have to perform the same kid
header replacements on the toolbox templates (console.kid, main.kid,
and widgets.kid).

CatWalk will work after this hack, but clicking on the "admi18n" link
in the toolbox causes the server to hang.  To fix this, you'll have to
add a similar hack for "inter.kid" to view.py.

Sean

Reply via email to