automatically merge data from __global with output of views
automatically merge data from __global with output of views

this doesn't strike me as very djangonic, nor pythonic, but it provides
a fairly clear way of sending the same data to all views in an app. the
example is developing against is the _questions_ app, which renders the
Section models as tabs in the top-left of every page.

the best alternative that i can come up with is calling the __global
function in each view, and merging the output with the data we're
planning to render. which is even uglier than it sounds, because
python doesn't seem to support (dict + dict), nor is there any
way to merge giving precidence to the contents of the subject,
and dict.update doesn't return the dict! perhaps i'm missing
something. here's the shortest alternative i could figure:

  def __globals(req):
    return { "section": "mudkips" }

  def page_one(req):
    data = __globals(req)
    data.update({
      "page": "one" })

    return render_to_response(
      "page_one.html", data)

  def page_two(req):
    data = __globals(req)
    data.update({
      "page": "two" })

    return render_to_response(
      "page_two.html", data)

oh my! look at all that boilerplate. explicit is better, but i think
the magic performed by this commit is sufficiently useful to be exempt
from this rule.

rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy,rapidsms/rapidsms-legacy