title: Trouble accessing dictionary values inside a Django template
body: <p>Here's my view function:</p>
  
  <pre><code>def detail(request, movie_id):
      movie = Movie.objects.get(id = movie_id)
      movieReleases = Release.objects.filter(movie = movie)
      reviews = Review.objects.filter(movie = movie)
  
      initRating = 0
  
      if request.user.is_authenticated():
          user = Account.objects.get(user = request.user.id)
          try:
              myreview = Review.objects.get(movie = movie, user = user)
              initRating = myreview.rating
          except:
              pass
  
          releaseContext = dict()
          for release in movieReleases:
              if release.isReleased():
                  releaseContext[release.id] = {'buttonURL' : reverse('movies.views.add', args=(release.id,)), 'buttonText' : 'Add to cart'}
              elif MovieReleaseReminder.objects.filter(account=user, movie=release).exists():
                  releaseContext[release.id] = {'buttonURL' : reverse('movies.views.unsubscribeFromReleaseReminder', args=(release.id,)), 'buttonText' : 'Unsubscribe from release reminder'}
              else:
                  releaseContext[release.id] = {'buttonURL' : reverse('movies.views.subscribeForReleaseReminder', args=(release.id,)), 'buttonText' : 'Subscribe to release reminder'}
  
          if MovieUpdateSubscription.objects.filter(account=user, movie=movie).exists():
              movieSubscribeURL = reverse('movies.views.unsubscribeFromUpdates', args=(movie.id,))
              movieSubscribeButtonText = 'Unsubscribe from updates'
          else:
              movieSubscribeURL = reverse('movies.views.subscribeForUpdates', args=(movie.id,))
              movieSubscribeButtonText = 'Subscribe for updates'
  
      else:
          releaseContext = None
          movieSubscribeURL = None
          movieSubscribeButtonText = None
  
  
      averageRating = calculateAverageRating(movie)
  
      t = loader.get_template('movies/detail.html')
      c = RequestContext(request, {'movie' : movie,
                                   'movieReleases' : movieReleases,
                                   'releaseContext' : releaseContext,
                                   'reviews': reviews,
                                   'averageRating': averageRating,
                                   'initRating': initRating,
                                   'movieSubscribeURL' : movieSubscribeURL,
                                   'movieSubscribeButtonText' : movieSubscribeButtonText})
      return HttpResponse(t.render(c))
  </code></pre>
  
  <p>Here's the template code in question:</p>
  
  <pre><code>{% if movieReleases%}
      &lt;table border="1px"&gt;
          {% for release in movieReleases %}
              &lt;tr&gt;
                  &lt;td&gt;{{release.format}}&lt;/td&gt;
                  &lt;td&gt;{{release.region}}&lt;/td&gt;
                  &lt;td&gt;{{release.price}}&lt;/td&gt;
                  {% if user.is_authenticated %}
                      {% with release_id=release.id %}
                          &lt;td&gt;&lt;form action="{{ releaseContext.release_id.buttonURL }}" method="post"&gt;{% csrf_token %}&lt;input type="submit" value="{{ releaseContext.release_id.buttonText }}" /&gt;&lt;/form&gt;&lt;/td&gt;
                      {% endwith %}
                  {% endif %}
              &lt;/tr&gt;
          {% endfor %}
      &lt;/table&gt;
  {% endif %}
  </code></pre>
  
  <p>The problem is that both <code>{{ releaseContext.release_id.buttonURL }}</code> and <code>{{ releaseContext.release_id.buttonText }}</code> are evaluating to the empty string when the template is rendered, even though I've checked in the debugger that releaseContext has the appropriate data. What am I missing?</p>