Thanks Cory, The reason I used the inspect module was that I was thinking of a situation where someone comes along and changes the view name or we create another view for filtering, we can just add the few lines to the view. But I see how having this dependency on the stack can lead to subtle bugs. 
For now, I explicitly pass the view names to the two functions.
**Explicit is better than Implicit**