Changes between Version 1 and Version 2 of S3/FieldSelectors


Ignore:
Timestamp:
05/01/14 11:07:17 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/FieldSelectors

    v1 v2  
    139139{{{#!python
    140140# Filter expression valid for both project_project and org_office:
    141 query = S3FieldSelector("(location)$name") == "Example
     141query = S3FieldSelector("(location)$name") == "Example"
    142142}}}
    143143
    144144Only when the field selector gets resolved against each resource (e.g. during add_filter), the "(location)" part is translated according to the respective "context" configuration.
    145145
     146It is possible to include the target field in the context expression:
     147
     148E.g. in this example, if we wanted to filter by location_id, then "(location)" would be a valid field selector for both resources:
     149
     150{{{#!python
     151# Filter expression valid for both project_project and org_office:
     152query = S3FieldSelector("(location)") == 43L
     153}}}
     154
     155Context paths can be used for various purposes, e.g.
     156
     157  - profile pages which show multiple resources all in the "context" of the same primary record, e.g. all offices, projects, etc related to the same location (=primary record)
     158  - filter forms across multiple resources (dashboards, not implemented yet)
     159  - global filters for all pages (s3db.context)