Opened 9 years ago
Last modified 9 years ago
#12140 closed enhancement
Replace uses of ticket.values with Ticket item accessors — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.2 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | refactoring |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
The ticket class implements __getitem__
and __setitem__
to set and get from the values
attribute, but many places in the code still work with the values
attribute directly. For example, ticket.values['reporter']
has been used since [1831] but it appears it can be replaced with ticket['reporter']
.
Directly setting to values
could even be problematic due to the logic in __setitem__
: tags/trac-1.1.6/trac/ticket/model.py#L186.
I considered trying to make values
a protected attribute, but it is used to serialize the ticket properties: