get 'q' method to work in template