title: django Get foreign-key model in view and show in html
body: <p>So I have two models:</p>
  
  <pre><code>class UserMeasurements(models.Model):
      user = models.CharField(max_length=20)
      time = models.DateTimeField(blank=True, null=True)
      set = models.ForeignKey(PhotoSets, models.DO_NOTHING)
  
      class Meta:
          managed = False
          db_table = 'user_measurements'
  
  class PhotoSets(models.Model):
      image_dir = models.CharField(max_length=200)
      machine = models.ForeignKey(Machine, models.DO_NOTHING)
      set_id = models.AutoField(primary_key=True)
      photo_taken_time = models.DateTimeField(blank=True, null=True)
  
      class Meta:
          managed = False
          db_table = 'photo_sets'
  </code></pre>
  
  <p>In the view.py I have :</p>
  
  <pre><code>def Main(request):
      measurement_list = UserMeasurements.objects.order_by('-time')
      photo_set_list = PhotoSets.objects.all()
      a = measurement_list.set.get_field('PhotoSets').rel.to
      //this is where I try to get the related models
      print str(a)
      return render(request, 'main.html', {'measurement_list': measurement_list})
  </code></pre>
  
  <p>I am trying to show the image_dir in the webpage with every User Measurement.
  I checked other stackoverflow questions. But still I can't figure it out. </p>
  
  <p>Thanks in advance.</p>