class DummyReq:
def __init__(self, href):
self.href = href
self.authname = ''
req = DummyReq(Href(''))
...
# Create the Query Object.
query = Query.from_string(self.env, query_string)
# Execute the query. Unique ID should return one row
rows = query.execute(req)
But that's gross. How can I get a req inside a ticket change listener?
Chris
--
Christopher Nelson, Software Engineering Manager
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: +1.518.877.5173, Fax: +1.518.877.8346 www.sixnet.com
The short answer is you can't. There has been some effort to avoid
requiring request objects everywhere, but it seems this hasn't yet
reached the ticket queries. As you have already found out, the query
only needs an Href object, the current authname, and the current timezone.
The Href could be made optional, and if it's missing, no ['href'] item
would be generated. The authname and timezone could be passed as
explicit arguments to count(), execute() and get_sql().
If you can produce a patch that fixes these occurrences of the request
object, I could apply it to trunk.
-- Remy
Done (http://trac.edgewall.org/ticket/9935). Thanks.