Package trac :: Package ticket :: Module model :: Class Ticket

Class Ticket

source code

object --+
         |
        Ticket

Instance Methods
 
__init__(self, env, tkt_id=None, db=None, version=None)
in version 1.1.1
source code
 
__getitem__(self, name) source code
 
__setitem__(self, name, value)
Log ticket modifications so the table ticket_change can be updated
source code
 
get_value_or_default(self, name)
Return the value of a field or the default value if it is undefined
source code
 
get_default(self, name)
Return the default value of a field.
source code
 
populate(self, values)
Populate the ticket with 'suitable' values from a dictionary
source code
 
insert(self, when=None, db=None)
Add ticket to database.
source code
 
save_changes(self, author=None, comment=None, when=None, db=None, cnum='', replyto=None)
Store ticket changes in the database.
source code
 
get_changelog(self, when=None, db=None)
Return the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue, permanent).
source code
 
delete(self, db=None)
Delete the ticket.
source code
 
get_change(self, cnum=None, cdate=None, db=None)
Return a ticket change by its number or date.
source code
 
delete_change(self, cnum=None, cdate=None, when=None)
Delete a ticket change identified by its number or date.
source code
 
modify_comment(self, cdate, author, comment, when=None)
Modify a ticket comment specified by its date, while keeping a history of edits.
source code
 
get_comment_history(self, cnum=None, cdate=None, db=None)
Retrieve the edit history of a comment identified by its number or date.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
 
id_is_valid(num) source code
Class Variables
  protected_fields = ('resolution', 'status', 'time', 'changetime')
Properties
  time_created
  time_changed
  exists

Inherited from object: __class__

Method Details

__init__(self, env, tkt_id=None, db=None, version=None)
(Constructor)

source code 
in version 1.1.1
Overrides: object.__init__

insert(self, when=None, db=None)

source code 

Add ticket to database.

in version 1.1.1

save_changes(self, author=None, comment=None, when=None, db=None, cnum='', replyto=None)

source code 

Store ticket changes in the database. The ticket must already exist in the database. Returns False if there were no changes to save, True otherwise.

in version 1.1.1 :since 1.0: the cnum parameter is deprecated, and threading should be controlled with the replyto argument

get_changelog(self, when=None, db=None)

source code 

Return the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue, permanent).

While the other tuple elements are quite self-explanatory, the permanent flag is used to distinguish collateral changes that are not yet immutable (like attachments, currently).

in version 1.1.1

delete(self, db=None)

source code 

Delete the ticket.

in version 1.1.1

get_change(self, cnum=None, cdate=None, db=None)

source code 

Return a ticket change by its number or date.

in version 1.1.1

get_comment_history(self, cnum=None, cdate=None, db=None)

source code 

Retrieve the edit history of a comment identified by its number or date.

in version 1.1.1


Property Details

time_created

Get Method:
unreachable(self)

time_changed

Get Method:
unreachable(self)

exists

Get Method:
unreachable(self)