Edgewall Software

Ticket #5998 (new defect)

Opened 12 months ago

Last modified 2 months ago

Add support for grouping, ordering, and column sets to default queries

Reported by: scottb@… Owned by: mgood
Priority: normal Milestone: 0.11.3
Component: report system Version: 0.11-stable
Severity: normal Keywords: query review
Cc: dkg-debian.org@…, jashugan@…, jorge@…, me@…

Description (last modified by cboos) (diff)

In the trac.ini file there's options for the default query strings:

[query] 
default_anonymous_query = status!=closed&cc~=$USER 
default_query = status!=closed&owner=$USER 

I'd like to see support for grouping, ordering, and column options added for these default queries. For example something like

default_query = status!=closed&owner=$USER&group=status&order=priority&col=id|summary|type 
  or
default_query = status!=closed&owner=$USER&group=status&order=priority&col=id&col=summary&col=type 

Attachments

query.patch (2.4 kB) - added by me@… 2 months ago.
patch for full query support in trac.ini
query.diff (2.4 kB) - added by me@… 2 months ago.
[patch] use this one.
query.2.patch (2.0 kB) - added by Stephen Prater <me@…> 2 months ago.

Change History

  Changed 10 months ago by cboos

  • keywords query added
  • version set to devel
  • type changed from enhancement to defect
  • description modified (diff)
  • milestone set to 0.11.1

Right, this should also support grouping and specifying the columns to be complete.

  Changed 8 months ago by Daniel Kahn Gillmor <dkg-debian.org@…>

  • cc dkg-debian.org@… added

I'd like to see this also, if possible. It's odd that ordering seems to work from a query:order=summary style link, but not from default_query. That suggests maybe there could be better code reuse?

  Changed 4 months ago by jashugan@…

  • cc jashugan@… added

  Changed 3 months ago by jorge@…

  • cc jorge@… added

I am also waiting for this to be implemented.

Changed 2 months ago by me@…

patch for full query support in trac.ini

Changed 2 months ago by me@…

[patch] use this one.

follow-up: ↓ 6   Changed 2 months ago by Stephen Prater <me@…>

  • cc me@… added
  • keywords review added
  • version changed from devel to 0.11-stable

okay, I don't know why you can't see the patch if you click on it, but if you download it it works.

it's patched against .11-stable.

in reply to: ↑ 5   Changed 2 months ago by cboos

Replying to Stephen Prater <me@stephenprater.com>:

okay, I don't know why you can't see the patch if you click on it, but if you download it it works.

No it's not a proper patch:

File to patch: trac/ticket/query.py
patching file trac/ticket/query.py
patch: **** malformed patch at line 29: @@ -759,16 +777,28 @@

it's patched against .11-stable.

Besides your added code contains a mix of space and tabs, please don't use tabs (see PEP:0008, look for Tabs or Spaces?).

Changed 2 months ago by Stephen Prater <me@…>

  Changed 2 months ago by Stephen Prater <me@…>

well, here it cleaned up. this time i patched it against trunk.

it's definitely sort of hacky - there's problems with the "rows" vs "row" in the query language vs. the request, and i'm not sure that "faking" request arguments is really the best approach here. It seemed like the least involved.

The point being - you should definitely view this as a starting point, and not something final. I hacked it in because I needed the functionality, and I thought I'd share.

Add/Change #5998 (Add support for grouping, ordering, and column sets to default queries)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change. Next status will be 'new'
The owner will change to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.