[Zope3-checkins] CVS: Products3/bugtracker/browser - configure.zcml:1.6 tracker.py:1.6 tracker_settings.pt:1.2
Stephan Richter
srichter@cosmos.phy.tufts.edu
Mon, 28 Jul 2003 13:14:20 -0400
Update of /cvs-repository/Products3/bugtracker/browser
In directory cvs.zope.org:/tmp/cvs-serv11336/browser
Modified Files:
configure.zcml tracker.py tracker_settings.pt
Log Message:
I dunno what bit me, but I thought that having numeric bug ids would be
better. It turns out that a lot of the Zope 3 machinery depends on the
names being strings, so I useually convert the names to strings anyway.
Oh well.
I also implemented default values for the vocabularies. Updated the export/
import accordingly.
=== Products3/bugtracker/browser/configure.zcml 1.5 => 1.6 ===
--- Products3/bugtracker/browser/configure.zcml:1.5 Mon Jul 28 07:49:36 2003
+++ Products3/bugtracker/browser/configure.zcml Mon Jul 28 13:13:45 2003
@@ -75,6 +75,7 @@
menu="zmi_views" title="Settings" />
<browser:page name="addValue.html" attribute="addValue" />
<browser:page name="deleteValues.html" attribute="deleteValues" />
+ <browser:page name="setDefaultValue.html" attribute="setDefaultValue" />
</browser:pages>
<browser:pages
=== Products3/bugtracker/browser/tracker.py 1.5 => 1.6 ===
--- Products3/bugtracker/browser/tracker.py:1.5 Mon Jul 28 07:49:36 2003
+++ Products3/bugtracker/browser/tracker.py Mon Jul 28 13:13:45 2003
@@ -36,7 +36,7 @@
menu_id = "add_bugtracker"
def add(self, content):
- name = self.context.setObject('', content)
+ name = self.context.setObject('dummy', content)
self.contentName = str(name)
return self.context[name]
@@ -49,20 +49,20 @@
if self.request.get('setup_vocabs'):
vocab = getAdapter(content, IStatusVocabulary)
- vocab.add('new', u'New')
+ vocab.add('new', u'New', True)
vocab.add('open', u'Open')
vocab.add('assigned', u'Assigned')
vocab.add('deferred', u'Deferred')
vocab.add('closed', u'Closed')
vocab = getAdapter(content, IBugTypeVocabulary)
- vocab.add('bug', u'Bug')
+ vocab.add('bug', u'Bug', True)
vocab.add('feature', u'Feature')
vocab.add('release', u'Release')
vocab = getAdapter(content, IReleaseVocabulary)
- vocab.add('None', u'(not specified)')
+ vocab.add('None', u'(not specified)', True)
vocab = getAdapter(content, IPriorityVocabulary)
vocab.add('low', u'Low')
- vocab.add('normal', u'Normal')
+ vocab.add('normal', u'Normal', True)
vocab.add('urgent', u'Urgent')
vocab.add('critical', u'Critical')
@@ -91,6 +91,11 @@
vocab = ManagableVocabularyView(self.context, self.request, iface)
vocab.deleteValues(values)
+ def setDefaultValue(self, iface, values):
+ iface = filter(lambda i: i.getName() == iface, self.ifaces)[0]
+ vocab = ManagableVocabularyView(self.context, self.request, iface)
+ vocab.setDefault(values[0])
+
class ManagableVocabularyView(object):
@@ -117,6 +122,15 @@
def title(self):
vocab = getAdapter(self.context, self.vocab_iface)
return vocab.title
+
+ def default(self):
+ vocab = getAdapter(self.context, self.vocab_iface)
+ return vocab.default
+
+ def setDefault(self, value):
+ vocab = getAdapter(self.context, self.vocab_iface)
+ vocab.default = value
+ return self.request.response.redirect('./@@settings.html')
def checkBug(bug, criteria, search_text):
=== Products3/bugtracker/browser/tracker_settings.pt 1.1 => 1.2 ===
--- Products3/bugtracker/browser/tracker_settings.pt:1.1 Thu Jul 24 14:08:10 2003
+++ Products3/bugtracker/browser/tracker_settings.pt Mon Jul 28 13:13:45 2003
@@ -24,6 +24,12 @@
</tal:block>
</select>
<input type="submit" name="deleteValues.html:method" value="Delete" />
+ <input type="submit" name="setDefaultValue.html:method"
+ value="Set Default" />
+ <br>
+ <b>Default Value:</b>
+ <span tal:define="default vocab/default"
+ tal:content="string: ${default/title} (${default/value})" />
<br>
Value: <input type="text" size="10" name="value" />