Opened 18 years ago
Closed 16 years ago
#4019 closed defect (fixed)
[PATCH] - Ticket Api does not contain 'time' and 'changetime' fields
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | ticket system | Version: | devel |
Severity: | normal | Keywords: | created lastmodified |
Cc: | mjs@…, goncha@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
source:trunk/trac/ticket/api.py@3935#L88
The attached patch introduces the fields 'time' and 'changetime' to the ticket api.
This enables e.g. sorting on those fields within queries (ticket-query-macro).
(sidenote: "'type': 'text'" can be possibly changed later e.g. to "datetime", in order to allow formatting of the values within the UI)
context: http://dev.lazaridis.com/base/wiki/PlanTicketQueryMacro
Attachments (3)
Change History (17)
by , 18 years ago
Attachment: | TicketApiAddMissingFields.diff added |
---|
follow-up: 2 comment:1 by , 18 years ago
comment:2 by , 18 years ago
Replying to cmlenz:
I've not tried the patch, but doesn't this mean those fields are going to be displayed among the other form fields on the newticket/ticket pages?
yes, you are right.
I guess I've missinterpreted the meaning of "Ticket Api".
comment:3 by , 18 years ago
The Query uses "TicketSystem(self.env).get_ticket_fields()" to get the ticket fields:
source:trunk/trac/ticket/query.py#rev=3935#L51
'time' and 'changetime' are missing, thus ordering does not work.
possibly changing get_ticket_fields() to
get_ticket_fields(all=false)
This would keep existent behaviour, but would return those missing fields on request (setting all=true).
or alternatively
get_ticket_fields(for_gui=True)
would this be ok?
by , 18 years ago
Attachment: | TicketApiAddMissingFieldsOptional.diff added |
---|
patch with added option "all_fields"
follow-ups: 5 7 comment:4 by , 18 years ago
I'm -1 on this. The get_ticket_fields
function is intended for fields that should be user-editable. The Ticket
model class has attributes time_created
and time_changed
for accessing that information. I don't have problem with the query supporting filtering or sorting by the creation or changed date/time, but I don't think it requires adding those to get_ticket_fields
.
follow-up: 6 comment:5 by , 18 years ago
Replying to mgood:
I'm -1 on this. The
get_ticket_fields
function is intended for fields that should be user-editable. TheTicket
model class has attributestime_created
andtime_changed
for accessing that information. I don't have problem with the query supporting filtering or sorting by the creation or changed date/time, but I don't think it requires adding those toget_ticket_fields
.
what would you suggest to get all tickest closed in the last week/month? or the tickets closed by user x in the last month?
follow-up: 9 comment:6 by , 18 years ago
Replying to ThurnerRupert <rupert.thurner@gmail.com>:
what would you suggest to get all tickest closed in the last week/month? or the tickets closed by user x in the last month?
An answer to this would go out of the scope of this ticket, which is just the inclusion of the 'time' and 'changetime' fields into the 'get_ticket_fields' function.
see further comments within:
http://groups.google.com/group/trac-dev/msg/7c9edb15d47434bb
a summary: include the fields into "get_ticket_fields" and ensure that systems using this function ignore the fields that they cannot handle.
I'll try to post a followup patch which covers the "add-filter" issue.
comment:7 by , 18 years ago
Replying to mgood:
I'm -1 on this. The
get_ticket_fields
function is intended for fields that should …
due to temporary problems with trac-anti-spam, comment here:
http://groups.google.com/group/trac-dev/msg/78fc1a819c87ea9f
comment:8 by , 18 years ago
please ignore the last attached file (TicketQueryMissingFieldsByMgood.diff), as the patch does not work.
comment:9 by , 18 years ago
Replying to ilias@lazaridis.com:
I'll try to post a followup patch which covers the "add-filter" issue.
comment:10 by , 18 years ago
Cc: | added |
---|
comment:11 by , 18 years ago
Description: | modified (diff) |
---|---|
Keywords: | created lastmodified added |
Milestone: | → 0.11 |
comment:12 by , 16 years ago
Cc: | added |
---|---|
Milestone: | 0.11.2 → 0.12 |
The latest patch related to #2288 also addresses this.
comment:14 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've not tried the patch, but doesn't this mean those fields are going to be displayed among the other form fields on the newticket/ticket pages?