Edgewall Software

Opened 16 years ago

Closed 15 years ago

Last modified 5 years ago

#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:


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
    116116              r"""(?P<tickethref>!?#(?P<t_intertrac>[a-zA-z]?)\d+)""",
    117117              r"""(?P<changesethref>!?\[(?P<c_intertrac>[a-zA-z]?)\d+\])""",
    118118              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>("(.*?)"|'(.*?)')|([^ ]*[^\., \)]))))""",
    120120              r"""(?P<wikilink>!?(^|(?<=[^A-Za-z]))[A-Z][a-z]+(?:[A-Z][a-z]*[a-z/])+(?=\Z|\s|,|\.|:|\)))""",
    121121              r"""(?P<fancylink>!?\[(?P<fancyurl>([a-z]+:[^ ]+)) (?P<linkname>.*?)\])"""]
    258258                return self._href.wiki(args), '%s:%s' % (module, args), 0, None
    259259        elif module == 'report':
    260260            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
    261266        elif module == 'changeset':
    262267           cursor = self.db.cursor ()
    263268           cursor.execute('SELECT message FROM revision WHERE rev=%s', args)

Attachments (0)

Change History (6)

comment:1 by Christopher Lenz, 16 years ago

Keywords: query added
Milestone: 0.9
Owner: changed from Jonas Borgström to Christopher Lenz

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:

= is
!= is not
~= contains
!~= does not contain
= begins with
$= ends with
greater than
less than

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:


comment:2 by cboos@…, 16 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 Christopher Lenz, 16 years ago

Status: newassigned

comment:4 by cboos@…, 15 years ago

Severity: normalenhancement

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:5 by Christopher Lenz, 15 years ago

Resolution: fixed
Status: assignedclosed

Implemented in [1362].

comment:6 by Ryan J Ollos, 5 years ago

Reporter: changed from cboos@… to Christian Boos

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.