Package trac :: Package ticket :: Module query :: Class Query

Class Query

source code

object --+
         |
        Query

Instance Methods
 
__init__(self, env, report=None, constraints=None, cols=None, order=None, desc=0, group=None, groupdesc=0, verbose=0, rows=None, page=None, max=None, format=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_columns(self) source code
 
get_all_textareas(self) source code
 
get_all_columns(self) source code
 
get_default_columns(self) source code
 
count(self, req=None, db=None, cached_ids=None, authname=None, tzinfo=None, locale=None)
Get the number of matching tickets for the present query.
source code
 
execute(self, req=None, db=None, cached_ids=None, authname=None, tzinfo=None, href=None, locale=None)
Retrieve the list of matching tickets.
source code
 
get_href(self, href, id=None, order=None, desc=None, format=None, max=None, page=None)
Create a link corresponding to this query.
source code
 
to_string(self)
Return a user readable and editable representation of the query.
source code
 
get_sql(self, req=None, cached_ids=None, authname=None, tzinfo=None, locale=None)
Return a (sql, params) tuple for the query.
source code
 
template_data(self, context, tickets, orig_list=None, orig_time=None, req=None) source code

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

Class Methods
 
from_string(cls, env, string, **kw) source code
Static Methods
 
get_modes() source code
Class Variables
  substitutions = ['$USER']
  clause_re = re.compile(r'(?P<clause>\d+)_(?P<field>.+)$')
Properties

Inherited from object: __class__

Method Details

__init__(self, env, report=None, constraints=None, cols=None, order=None, desc=0, group=None, groupdesc=0, verbose=0, rows=None, page=None, max=None, format=None)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

get_href(self, href, id=None, order=None, desc=None, format=None, max=None, page=None)

source code 

Create a link corresponding to this query.

Note: get_resource_url of a 'query' resource?

Parameters:
  • href - the Href object used to build the URL
  • id - optionally set or override the report id
  • order - optionally override the order parameter of the query
  • desc - optionally override the desc parameter
  • format - optionally override the format of the query
  • max - optionally override the max items per page
  • page - optionally specify which page of results (defaults to the first)

to_string(self)

source code 

Return a user readable and editable representation of the query.

Note: for now, this is an "exploded" query href, but ideally should be expressed in TracQuery language.