首页 > 代码库 > trac插件---due date
trac插件---due date
Due date作用是当测试人员创建ticket时,设置一个给开发人员解决bug的预期时间.
形成的效果图如下:
(1)下载setuptools-0.6c11-py2.4.egg
Shell>easy_install-2.4 setuptools-0.6c11-py2.4.egg
(2)安装datefieldplugin插件
Shell>easy_install-2.4 https://trac-hacks.org/svn/datefieldplugin/0.11/
(3)修改trac.ini
Shell> vim trac.ini
[components]
datefield.* = enabled
[ticket-custom]
due_date = text
due_date.date = true
due_date.label = Due Date
due_date.value = MM/DD/YYYY
due_date.date_empty = true
[datefield]
format = mdy
separator = /
first_day = 1
(4) 修改db_default.py
目的:在view tickets时看到due_date.
效果图如下:
Shell> pwd
/usr/lib/python2.4/site-packages/Trac-0.11.2.1-py2.4.egg/trac
在db_default.py中修改默认Reports的查询语句,以其中一个为例
## Default Reports
SELECT p.value AS __color__,
id AS ticket, summary, component, version, milestone, t.type AS type,
owner, status,
time AS created,
changetime AS _changetime, description AS _description,
reporter AS _reporter,c.value AS due_date
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = ‘priority‘ join ticket_custom c on t.id = c.ticket and c.name = ‘due_date‘
WHERE status <> ‘closed‘
ORDER BY """ + db.cast(‘p.value‘, ‘int‘) + """, milestone, t.type, time
"""),
本文出自 “笔记” 博客,请务必保留此出处http://sunflower2.blog.51cto.com/8837503/1549000
trac插件---due date