title: Cannot get selection from one page to another - need to know what choice user chose
body: <p>I'm trying to let the user select one 'thing' from a list (from the database), then go find other stuff in the database using that record.  But I cannot get the selection info from the selection page.</p>
  
  <p>I'll try to make this a pretty complete snapshot of the relevant code, but I may remove too much or leave too much in, sorry.</p>
  
  <p>my models.py:</p>
  
  <pre><code>urlpatterns = patterns('',
  url(r'^$', 'dblook.views.index', name='home'),
  url(r'^dblook3/', 'dblook.views.try3', name='home2'),
  url(r'^dblook4/', 'dblook.views.try4', name='home3'),
  )
  </code></pre>
  
  <p>my dblook/models.py:</p>
  
  <pre><code>from django.db import models
  class serial_number(models.Model):
      def __unicode__(self):
          return self.serialno
          #return self.question
      class Meta:
          managed=False
          db_table='serial_number'
      sn_id = models.AutoField(primary_key=True)
      serialno = models.CharField(max_length=128)
      comment = models.ForeignKey(comment,null=True,db_column='comment')
  </code></pre>
  
  <p>my views.py (I will skip all the imports other than the database model import.  If anyone really wants them I'll update with them)</p>
  
  <pre><code>from dblook.models import *
  class SerialnoSelectForm(forms.Form):
      serialno = forms.CharField(max_length=16)
      selected = forms.BooleanField()
  
  class serialform(ModelForm):
      class Meta:
          model = serial_number
          exclude=('comment','sn_id')
      selected = forms.BooleanField()
  
  class snselect(forms.Form):
      sno = forms.ChoiceField()
  
  def try3(request):
      if ( request.POST ):
          output = "HEllo world, thanks for posting"
          return HttpResponse(output)
      else:
          sslst = snselect(serial_number.objects.filter(serialno__startswith="A128").order_by('-serialno'))
          t = loader.get_template('select_serialno.html')
          c = Context({
              'sslst': sslst,
              })
          c.update(csrf(request))
          return HttpResponse(t.render(c))
  
  def try4(request,dsn):
      if ( request.POST ):
          output = "HEllo world, thanks for posting to 4"
          return HttpResponse(output)
      else:
          return HttpResponse("Error")
  </code></pre>
  
  <p>And my template (select_serialno.html) is:</p>
  
  <pre><code>&lt;h1&gt;Select a serial number&lt;/h1&gt;
   &lt;ul&gt;
     &lt;form method='post' action'='/dbtest4/{{serial_number.sn_id}}/showme'&gt;
       {% csrf_token %}
       {% for sn in sslst %}
       &lt;input type="submit" name="sn.serialno" id="choice{{ forloop.counter }}" value="{{choice.id}}"/&gt;
       &lt;label for="choice{{ forloop.counter }}"&gt;{{ sn.serialno }}&lt;/label&gt;&lt;br/&gt;
       {% endfor %}
       &lt;input type="submit" value="data" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When I go to dblook3, I get a nice list from the database of serial numbers, along with a button that, if I hit goes immediately to the dblook4 URL (in this case, its ALWAYS '/dbtest4//showme/' instead of something like '/dbtest4/3/showme/).  Unfortunately, I cannot seem to have any way to tell what button they hit. </p>
  
  <p>No matter WHAT I put in for the 'stuff' in <code>&lt;form method='post' action'='/dbtest/{{stuff}}/showme'&gt;</code>, it is always empty.</p>
  
  <p>I also tried things like <code>if( 'choice' in request.POST ):</code> in try4 in veiws.py, but that didn't work either.</p>
  
  <p>So, how do I get ANY information about what was selected from 'look3' over to 'look4'?  I'll take just about anything...  However, if you can explain why I'm doing that hopefully your answer will not only solve my problem, but help others understand...</p>
  
  <p>(if the above looks pretty 'evolutionary' that's because I've been hacking on this for 3 days now...)</p>
  
  <p>Thanks!</p>