Re: error with minimal template
Tonu Mikk <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <CABDFm8hsBjnHL7_sY3fvfzsUrdO5XJzj4ArmiEt+tFb1_ui1zg@mail.gmail.com> |
Thanks John, I removed the references to queries and issues in the page.html leaving only the items related to users. Now the minimal template works. I am attaching the page.html in case it is useful. On Mon, Sep 10, 2018 at 4:35 PM, John P. Rouillard <[email protected]> wrote: > Hi Tonu: > > In message <CABDFm8g+yySJykbY=xEAMDfF-ncxWXs1UjdHPLt2idtq1ccBNQ@ > mail.gmail.com> > , > Tonu Mikk writes: > >I went ahead and removed references to the keyword in page.html. I > removed > >the lines where the "keyword" appeared and also removed the entire menu > >block for keywords. After doing this I accessed the trackers web > interface > >again and received this error. > > Well at least it's a different error. Solution is the same remove > references to queries. > > The only explanation I have is that at some point the classic > page.html must have replaced the minimal page.html. > > If you want to continue as a learning exercise, keep trimming > references to classes out of page.html. From what I see almost all of > page.html should be removed including search etc. as there isn't even > an issue class defined. So the search bar that is there isn't even > valid since it's searching a non-existent class. > > The only classes defined in the minimal template are the required user > class. It then populates that user class with the admin and anonymous > users. > > >Running of the tracker based on the minimal template is not a high > >priority for me. I am doing it for demonstration and learning > >purposes. Thanks! > > > >Traceback (most recent call last): > > [...] > > File "/usr/lib/python2.7/site-packages/roundup/cgi/ > PageTemplates/Expressions.py", > >line 323, in restrictedTraverse > > o = object[name] > > File "/usr/lib/python2.7/site-packages/roundup/cgi/templating.py", line > >808, in __getitem__ > > prop = self._props[items[0]] > >KeyError: 'queries' > > Yeah, <grumble> I should have taken a better look at page.html and the > defined schema. Sorry I missed that. > > Have a great day. > -- > -- rouilj > John Rouillard > ============================================================ > =============== > My employers don't acknowledge my existence much less my opinions. > _______________________________________________ > Roundup-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/roundup-users > -- Tonu Mikk Adaptive Technologist | Disability Resource Center | diversity.umn.edu/disability University of Minnesota | umn.edu [email protected] | 612-625-3307 _______________________________________________ Roundup-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/roundup-users
page.html
(text/html, 9.9 KB)
<!-- vim:sw=2 sts=2
--><tal:block metal:define-macro="icing"
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title metal:define-slot="head_title">title goes here</title>
<link rel="stylesheet" type="text/css" href="@@file/style.css">
<meta http-equiv="Content-Type"
tal:attributes="content string:text/html;; charset=${request/client/charset}" />
<script tal:replace="structure request/base_javascript">
</script>
<metal:x define-slot="more-javascript" />
</head>
<body class="body">
<table class="body"
tal:define="
columns string:id,activity,title,creator,status;
columns_showall string:id,activity,title,creator,assignedto,status;
status_notresolved string:-1,1,2,3,4,5,6,7;
"
>
<tr>
<td class="page-header-left"> </td>
<td class="page-header-top">
<div id="body-title">
<h2><span metal:define-slot="body_title">body title</span></h2>
</div>
</td>
</tr>
<tr>
<td rowspan="2" valign="top" class="sidebar">
<p class="classblock"
tal:condition="python:request.user.hasPermission('View', 'user')">
<b i18n:translate="">Administration</b><br>
<span tal:condition="python:request.user.hasPermission('Edit', None)">
<a href="home?@template=classlist" i18n:translate="">Class List</a><br>
</span>
<span tal:condition="python:request.user.hasPermission('View', 'user')
or request.user.hasPermission('Edit', 'user')">
<a href="user" i18n:translate="">User List</a><br>
</span>
<a tal:condition="python:request.user.hasPermission('Create', 'user')"
href="user?@template=item" i18n:translate="">Add User</a>
</p>
<form method="POST" tal:condition="python:request.user.username=='anonymous'"
tal:attributes="action request/base">
<p class="userblock">
<b i18n:translate="">Login</b><br>
<input size="10" name="__login_name"><br>
<input size="10" type="password" name="__login_password"><br>
<input type="hidden" name="@action" value="Login">
<input type="checkbox" name="remember" id="remember">
<label for="remember" i18n:translate="">Remember me?</label><br>
<input type="submit" value="Login" i18n:attributes="value"><br>
<input type="hidden" name="__came_from" tal:attributes="value string:${request/base}${request/env/PATH_INFO}">
<span tal:replace="structure request/indexargs_form" />
<a href="user?@template=register"
tal:condition="python:request.user.hasPermission('Register', 'user')"
i18n:translate="">Register</a><br>
<a href="user?@template=forgotten" i18n:translate="">Lost your login?</a><br>
</p>
</form>
<p class="userblock" tal:condition="python:request.user.username != 'anonymous'">
<b i18n:translate="">Hello, <span i18n:name="user"
tal:replace="python:request.user.username.plain(escape=1)">username</span></b><br>
<a href="#" tal:attributes="href string:user${request/user/id}"
i18n:translate="">Your Details</a><br>
<a href="#" tal:attributes="href python:request.indexargs_url('',
{'@action':'logout'})" i18n:translate="">Logout</a>
</p>
<p class="userblock">
<b i18n:translate="">Help</b><br>
<a href="http://www.roundup-tracker.org"
i18n:translate="">Roundup docs</a>
</p>
</td>
<td>
<p tal:condition="options/error_message | nothing" class="error-message"
tal:repeat="m options/error_message"
tal:content="structure string:$m <br/ > " />
<p tal:condition="options/ok_message | nothing" class="ok-message">
<span tal:repeat="m options/ok_message"
tal:content="structure string:$m <br/ > " />
<a class="form-small" tal:attributes="href request/current_url"
i18n:translate="">clear this message</a>
</p>
</td>
</tr>
<tr>
<td class="content" metal:define-slot="content">Page content goes here</td>
</tr>
</table>
<pre tal:condition="request/form/debug | nothing" tal:content="request">
</pre>
</body>
</html>
</tal:block>
<!--
The following macros are intended to be used in search pages.
The invoking context must define a "name" variable which names the
property being searched.
See issue.search.html in the classic template for examples.
-->
<!-- creates a th and a label: -->
<th metal:define-macro="th_label"
tal:define="required required | python:[]"
tal:attributes="class python:(name in required) and 'required' or nothing">
<label tal:attributes="for name" tal:content="label" i18n:translate="">text</label>
<metal:x define-slot="behind_the_label" />
</th>
<td metal:define-macro="search_input">
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
name name;
id name">
</td>
<td metal:define-macro="search_date">
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
name name;
id name">
<a class="classhelp"
tal:attributes="href python:'''javascript:help_window('issue?@template=calendar&property=%s&form=itemSynopsis', 300, 200)'''%name">(cal)</a>
</td>
<td metal:define-macro="search_popup">
<!--
context needs to specify the popup "columns" as a comma-separated
string (eg. "id,title" or "id,name,description") as well as name
-->
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
name name;
id name">
<span tal:replace="structure python:db[db_klass].classhelp(columns,
property=name)" />
</td>
<td metal:define-macro="search_select">
<select tal:attributes="name name; id name"
tal:define="value python:request.form.getvalue(name)">
<option value="" i18n:translate="">don't care</option>
<metal:slot define-slot="extra_options" />
<option value="" i18n:translate="" disabled="disabled">------------</option>
<option tal:repeat="s python:db[db_klass].list()"
tal:attributes="value s/id; selected python:value == s.id"
tal:content="python:s[db_content]"></option>
</select>
</td>
<!-- like search_select, but translates the further values.
Could extend it (METAL 1.1 attribute "extend-macro")
-->
<td metal:define-macro="search_select_translated">
<select tal:attributes="name name; id name"
tal:define="value python:request.form.getvalue(name)">
<option value="" i18n:translate="">don't care</option>
<metal:slot define-slot="extra_options" />
<option value="" i18n:translate="" disabled="disabled">------------</option>
<option tal:repeat="s python:db[db_klass].list()"
tal:attributes="value s/id; selected python:value == s.id"
tal:content="python:s[db_content]"
i18n:translate=""></option>
</select>
</td>
<!-- currently, there is no convenient API to get a list of all roles -->
<td metal:define-macro="search_select_roles"
tal:define="onchange onchange | nothing">
<select name=roles id=roles tal:attributes="onchange onchange">
<option value="" i18n:translate="">don't care</option>
<option value="" i18n:translate="" disabled="disabled">------------</option>
<option value="User">User</option>
<option value="Admin">Admin</option>
<option value="Anonymous">Anonymous</option>
</select>
</td>
<td metal:define-macro="search_multiselect">
<input tal:attributes="value python:request.form.getvalue(name) or nothing;
name name;
id name">
<span tal:replace="structure python:db[db_klass].classhelp(db_content,
property=name, width='600')" />
</td>
<td metal:define-macro="search_checkboxes">
<ul class="search-checkboxes"
tal:define="value python:request.form.getvalue(name);
values python:value and value.split(',') or []">
<li tal:repeat="s python:db[db_klass].list()">
<input type="checkbox" tal:attributes="name name; id string:$name-${s/id};
value s/id; checked python:s.id in values" />
<label tal:attributes="for string:$name-${s/id}"
tal:content="python:s[db_content]" />
</li>
<li metal:define-slot="no_value_item">
<input type="checkbox" value="-1" tal:attributes="name name;
id string:$name--1; checked python:value == '-1'" />
<label tal:attributes="for string:$name--1" i18n:translate="">no value</label>
</li>
</ul>
</td>
<td metal:define-macro="column_input">
<input type="checkbox" name="@columns"
tal:attributes="value name;
checked python:name in cols">
</td>
<td metal:define-macro="sort_input">
<input type="radio" name="@sort"
tal:attributes="value name;
checked python:name == sort_on">
</td>
<td metal:define-macro="group_input">
<input type="radio" name="@group"
tal:attributes="value name;
checked python:name == group_on">
</td>
<!--
The following macros are intended for user editing.
The invoking context must define a "name" variable which names the
property being searched; the "edit_ok" variable tells whether the
current user is allowed to edit.
See user.item.html in the classic template for examples.
-->
<script metal:define-macro="user_utils" type="text/javascript" src="@@file/user_utils.js"></script>
<!-- src: value will be re-used for other input fields -->
<input metal:define-macro="user_src_input"
type="text" tal:attributes="onblur python:edit_ok and 'split_name(this)';
id name; name name; value value; readonly not:edit_ok"
value="heinz.kunz">
<!-- normal: no re-using -->
<input metal:define-macro="user_normal_input" type="text"
tal:attributes="id name; name name; value value; readonly not:edit_ok"
value="heinz">
<!-- password: type; no initial value -->
<input metal:define-macro="user_pw_input" type="password"
tal:attributes="id name; name name; readonly not:edit_ok" value="">
<input metal:define-macro="user_confirm_input" type="password"
tal:attributes="id name; name string:@confirm@$name; readonly not:edit_ok" value="">
<!-- SHA: 9d6c8378dfaf0bf63af7e5ab7432dbe1318d1260 -->