CRM Query

Requires Pro Edition and CRM plugin >= 3.3.0.

Manager

All operations on the CrmQuery resource are provided by its manager. To get access to it you have to call redmine.crm_query where redmine is a configured redmine object. See the Configuration about how to configure redmine object.

Create methods

Not supported by CRM plugin

Read methods

get

Added in version 2.1.0.

redminelib.managers.ResourceManager.get(resource_id, **params)

Returns single CrmQuery resource from the CRM plugin by its id.

Parameters:
  • resource_id (int) – (required). Id of the crm query.

  • resource (string) – (required). Get crm query for the resource. One of:

Returns:

Resource object

>>> query = redmine.crm_query.get(1, resource='contact')
>>> query
<redminelib.resources.CrmQuery #1 "By companies">

Hint

CrmQuery resource object provides you with some relations. Relations are the other resource objects wrapped in a ResourceSet which are somehow related to a CrmQuery resource object. The relations provided by the CrmQuery resource object are:

>>> queries = redmine.crm_query.filter(resource='deal')
>>> queries[0]
<redminelib.resources.CrmQuery #10 "Deals by category">
>>> queries[0].deals
<redminelib.resultsets.ResourceSet object with Deal resources>

all

Not supported by CRM plugin

filter

redminelib.managers.ResourceManager.filter(**filters)

Returns crm query resources that match the given lookup parameters.

Parameters:
  • resource (string) – (required). Get crm queries for the resource. One of:

  • limit (int) – (optional). How much resources to return.

  • offset (int) – (optional). Starting from what resource to return the other resources.

Returns:

ResourceSet object

>>> queries = redmine.crm_query.filter(resource='contact')
>>> queries
<redminelib.resultsets.ResourceSet object with CrmQuery resources>

Update methods

Not supported by CRM plugin

Delete methods

Not supported by CRM plugin

Export

Not supported by CRM plugin