本文整理汇总了Python中trac.ticket.api.TicketSystem.format_summary方法的典型用法代码示例。如果您正苦于以下问题:Python TicketSystem.format_summary方法的具体用法?Python TicketSystem.format_summary怎么用?Python TicketSystem.format_summary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.ticket.api.TicketSystem
的用法示例。
在下文中一共展示了TicketSystem.format_summary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_search_results
# 需要导入模块: from trac.ticket.api import TicketSystem [as 别名]
# 或者: from trac.ticket.api.TicketSystem import format_summary [as 别名]
def get_search_results(self, req, terms, filters):
"""Overriding search results for Tickets"""
if not "ticket" in filters:
return
ticket_realm = Resource("ticket")
with self.env.db_query as db:
sql, args = search_to_sql(
db, ["summary", "keywords", "description", "reporter", "cc", db.cast("id", "text")], terms
)
sql2, args2 = search_to_sql(db, ["newvalue"], terms)
sql3, args3 = search_to_sql(db, ["value"], terms)
ticketsystem = TicketSystem(self.env)
if req.args.get("product"):
productsql = "product='%s' AND" % req.args.get("product")
else:
productsql = ""
for summary, desc, author, type, tid, ts, status, resolution in db(
"""SELECT summary, description, reporter, type, id,
time, status, resolution
FROM ticket
WHERE (%s id IN (
SELECT id FROM ticket WHERE %s
UNION
SELECT ticket FROM ticket_change
WHERE field='comment' AND %s
UNION
SELECT ticket FROM ticket_custom WHERE %s
))
"""
% (productsql, sql, sql2, sql3),
args + args2 + args3,
):
t = ticket_realm(id=tid)
if "TICKET_VIEW" in req.perm(t):
yield (
req.href.ticket(tid),
tag_(
"%(title)s: %(message)s",
title=tag.span(get_resource_shortname(self.env, t), class_=status),
message=ticketsystem.format_summary(summary, status, resolution, type),
),
from_utimestamp(ts),
author,
shorten_result(desc, terms),
)
# Attachments
for result in AttachmentModule(self.env).get_search_results(req, ticket_realm, terms):
yield result