break out query generation logic into a get_catalog_query method
Merge branch 'master' of github.com:Pylons/substanced