Robert C Corsaro wrote: > [EMAIL PROTECTED] wrote: >> On Jul 25, 9:50 am, Robert C Corsaro <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] wrote: >>>> On Jul 25, 8:42 am, "Culapov Andrei" <[EMAIL PROTECTED]> wrote: >>>>> On Fri, Jul 25, 2008 at 3:11 PM, Emin <[EMAIL PROTECTED]> wrote: >>>>>> Dear Experts, >>>>>> The TicketQuery macro is really wonderful, so wonderful that I use it >>>>>> a lot and would like to ask about more features. Is there a way to >>>>>> control the order of the results? >>>>> add in the parameters list sort=ticket_field >>>>> For example, if I want to sort by >>>>>> date or by reverse ticket id or by user, is there a way to do that? >>>>>> Also, since TicketQuery is called a macro, this suggests that there is >>>>>> some source code for it that calls internals of Trac. Is there a way >>>>>> for users to add such macros? If so, could someone point me to the >>>>>> source code of TicketQuery and how I would write a version with more >>>>>> features? >>>>> The TicketQuery code you can find it in trac.ticket.query module. For >>>>> creating a macro take a look athttp://trac.edgewall.org/wiki/WikiMacros >>>>> I created a plugin that does something similar to TicketQuery and that >>>>> defines 3 new macros. The macros show counts of tickets based on a >>>>> query string. You can take a look >>>>> onhttp://code.optaros.com/trac/oforge/wiki/Dashboardpagefor more >>>>> information on it. >>>> This is nice, no information on how to get it and install it though, >>>> just a page of how it looks. >>>> Looks very nice btw. >>> $ svn >>> cohttp://code.optaros.com/svn/oforge/trunk/plugins/dashboardreportsplugin >>> $ cd dashboardreportsplugin >>> $ python setup.py install >>> >>> Tell us if anything doesn't work and we will fix it. If you want, you >>> can create tickets athttp://code.optaros.com/trac/oforge >> actually, after I made this post, I stumbled int it. >> >> I managed to get and install it, then create ticket #23 on your >> system. :) >> >> I can't wait to see this working on my tracs though :D >> >> Thanks, it's really a nice looking, and well thought out plugin. It >> will make my life easier to give the Manager types all sorts of shiny >> graphs to fiddle with! > > Oh poop! Embarrassingly, that actually relies on a patch to trac. > > > > Index: oforge/vendor/trac/trac/ticket/api.py > =================================================================== > --- oforge/vendor/trac/trac/ticket/api.py (revision 7385) > +++ oforge/vendor/trac/trac/ticket/api.py (working copy) > @@ -183,6 +183,17 @@ > valid_states.update(controller.get_all_status()) > return sorted(valid_states) > > + def get_all_ticket_fields(self): > + """New method until full integration of the new fields.""" > + fields = self.get_ticket_fields() > + > + # append the new ones > + fields.extend([{'name': 'time', 'type': 'date', 'label': > 'Created'}, > + {'name': 'changetime', 'type': 'date', > + 'label': 'Modified'}]) > + > + return fields > + > def get_ticket_fields(self): > """Returns the list of fields available for tickets.""" > from trac.ticket import model > > > You can do that, or wait until we fix it in the plugin. >
If that doesn't work for you, some other guys on my team that have left for the day can help. That may rely on some other plugin or something. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-users?hl=en -~----------~----~----~----~------~----~------~--~---
