Opened 13 years ago

Last modified 12 years ago

#8496 closed enhancement

Big change to the child table functionality — at Initial Version

Reported by: anonymous Owned by: Mark Ryan
Priority: normal Component: ChildTicketsPlugin
Severity: minor Keywords:
Cc: Trac Release: 0.11

Description

I've made a major change to the way that childticketsplugin handles the table of children. It has a few drawbacks but the benefits are very significant. I think it needs someone else to look over it and come up with some ways to tidy it up. changes are as follows:

  • Removed the child table completely - The code was building a table in full when trac has the wiki engine to do this
  • Added a custom field called childreport
  • Added a ticket_created and ticket_changed handler to update the childreport of the parent ticket with a TicketQuery macro

There are a few caveats.

  • If you change the macros, the parent does not get updated until you update a child.
  • The ticket_custom table is updated every time a ticket is changed, regardless of whether it needs to be
  • You cannot edit the childreport macro, it will always be overwritten when a child is modified

Benefits are pretty simple

  • Allows you to use wiki macros to define the table, i.e. grouping and data on rows
  • The wikitext field can also be used in custom queries

There are a few things I don't like. The code to handle the table_headers definition is a bit obscure. I've used a closure as it saves a bit of extra coding when i'm getting configuration directives but its not particularly readable. I've also not properly handled migrating from the child table to my version. Maybe we could add a config directive to tell it to use a field instead of rendering a table.

Screenshot of the ticket screen is also attached along with a diff

Pete

Change History (3)

Changed 13 years ago by anonymous

Attachment: reportWithChildTables.png added

Custom query with child tickets subtables

Changed 13 years ago by anonymous

Attachment: ticketWithChildTable.png added

Changed 13 years ago by anonymous

Attachment: childtickets.py.diff added
Note: See TracTickets for help on using tickets.