= Context = A context is a way of defining a filter for a resource by it's links to another resource. We access the filters via a common [wiki:S3/FieldSelectors FieldSelector] despite the back-end ther actual linkages varying from being as simple as a foreign key or going through a link table: * [wiki:S3/FieldSelectors#ContextPaths] The context filters are usually defined in the core models ({{{modules/s3db/*.py}}}), like: {{{ s3db.configure("project_project", context = {"location": "location.location_id", "organisation": "organisation_id", }, ) }}} This shows that: * if we want "All Projects related to Organisation X" then the back-end will do this by using the simple Foreign Key 'organisation_id', although we can access that via {{{(organisation)}}}. * if we want "All projects related to location Y" then the back-end will do this through the 'location' [wiki:S3/S3Model/ComponentResources Component], although we can access that via {{{(location)}}}. Contexts get used a lot by [wiki:S3Profile Profile pages].