I have created my own real estate module. I want to filter it by one of my fields "Inspection", however "Inspection" it not a cck field, it is a field that the module creates itself, so it doesn't appear in the view as an option to filter on.
I found this page: http://drupal.org/node/99794
which I think is about exactly what I want, but I find it very hard to read since it doesn't give proper examples, only little snippets of code that have php tags around them totally out of context and stuff. It's almost as poorly written as the drupal api; no code samples, no blogs, nothing! "here have a look at the code that makes the function work, rather than examples of how to use the function" arggh!!!!
So anyway I sucked it up and gave it a shot
/**
* Implementation of hook_views_tables().
*/
function residential_views_tables() {
$tables[' {re_residential} '] = array(
'join' => array(
'left' => array(
'table' => 'node',
'field' => 'nid',
),
),
'filters' => array(
'inspection1_start' => array(
'name' => t('Residential: Inspection 1 Start Date/Time'),
'help' => t('The time of first Inspection'),
'operator' => 'views_handler_operator_andor',
'value' => 'NULL',
),
),
);
return $tables;
}