#909 closed enhancement (fixed)
[patch] Support for query: link syntax in WikiFormatting
Reported by: | Christian Boos | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | wiki system | Version: | devel |
Severity: | normal | Keywords: | query |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The proposed addition is quite simple:
the query:
string should be followed directly
by the GET arguments.
As long as the query module uses the GET method, one can compose an arbitrarily complex query, and then copy/paste the link from the Web browser to the wiki page editor.
-
WikiFormatter.py
=== WikiFormatter.py ==================================================================
116 116 r"""(?P<tickethref>!?#(?P<t_intertrac>[a-zA-z]?)\d+)""", 117 117 r"""(?P<changesethref>!?\[(?P<c_intertrac>[a-zA-z]?)\d+\])""", 118 118 r"""(?P<reporthref>!?\{\d+\})""", 119 r"""(?P<modulehref>!?((?P<modulename>bug|ticket|browser|source|repos|report| changeset|wiki|milestone|search):(?P<moduleargs>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""",119 r"""(?P<modulehref>!?((?P<modulename>bug|ticket|browser|source|repos|report|query|changeset|wiki|milestone|search):(?P<moduleargs>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""", 120 120 r"""(?P<wikilink>!?(^|(?<=[^A-Za-z]))[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+(?=\Z|\s|,|\.|:|\)))""", 121 121 r"""(?P<fancylink>!?\[(?P<fancyurl>([a-z]+:[^ ]+)) (?P<linkname>.*?)\])"""] 122 122 … … 258 258 return self._href.wiki(args), '%s:%s' % (module, args), 0, None 259 259 elif module == 'report': 260 260 return self._href.report(args), '%s:%s' % (module, args), 0, None 261 elif module == 'query': 262 if args and args[0] == '?': 263 return self._href.query() + args, '%s:%s' % (module, args), 0, None 264 else: 265 return self._href.query(), '%s:%s' % (module, args), 1, None 261 266 elif module == 'changeset': 262 267 cursor = self.db.cursor () 263 268 cursor.execute('SELECT message FROM revision WHERE rev=%s', args)
Attachments (0)
Change History (6)
comment:1 by , 20 years ago
Keywords: | query added |
---|---|
Milestone: | → 0.9 |
Owner: | changed from | to
comment:2 by , 20 years ago
Yes, I understand that there's the room/need for a custom query mini-language…
Nevertheless, my proposal still stands:
- if the first character after the
query:
is?
, use what follows directly to form the query (the simple copy/paste way) - if not, parse the arguments according to the rules presented above (the query mini-language way)
comment:3 by , 20 years ago
Status: | new → assigned |
---|
comment:4 by , 20 years ago
Severity: | normal → enhancement |
---|
Just a reminder for this patch, which I find quite useful as it is now:
Form a custom query using the web interface, then copy
everything after the '?'
, and paste it in your link
after the '?'
:
[query:?<paste the query here> Reopened Bugs for XYZ]
comment:6 by , 9 years ago
Reporter: | changed from | to
---|
Good idea. What I was planning was to use a kind of mini-query-language in the link, in conjunction with the more powerful query capabilities currently being worked on on the query branch.
For example:
Meaning: all tickets with milestone set to 0.9 and owner set to cmlenz, where the severity field is not set to enhancement.
Operators supported might be:
Note that the range of available operators will be dependent on what can be represented in the new query UI, rather than on whether they're technically implementable.
For fields like status, resolution and custom fields of type "radio", you could OR option values, for example: