def filter_groups(request, query): """ Description: Performs a search and returns the resulting list of env groups. Params: $query - Hash: keys must match valid search fields. +------------------------------------------------------------------+ | Product Search Parameters | +------------------------------------------------------------------+ | Key | Valid Values | | id | Integer: ID of env group | | name | String | | manager | ForeignKey: Auth.user | | modified_by | ForeignKey: Auth.user | | is_active | Boolean | | property | ForeignKey: TCMSEnvProperty | +------------------------------------------------------------------+ Returns: Array: Matching env groups are retuned in a list of hashes. Example: # Get all of env group name contains 'Desktop' >>> Env.filter_groups({'name__icontains': 'Desktop'}) """ return TCMSEnvGroup.to_xmlrpc(query)
def get_env_groups(request, plan_id): """ Description: Get the list of env groups to the fields of this plan. Params: $plan_id - Integer: An integer representing the ID of this plan in the database Returns: Array: An array of hashes with env groups. """ from nitrate.apps.management.models import TCMSEnvGroup query = {'testplan__pk': plan_id} return TCMSEnvGroup.to_xmlrpc(query)