title: Getting all objects in a class without using loops django 1.8
body: <p>I have a template <code>navbar.html</code> where I store the template for navbar and then include it in <code>index.html</code> which is the base template. </p>
  
  <p><code>views.py</code></p>
  
  <pre><code>class NaverDetailView(generic.DetailView):
  model = Naver
  naver = Naver.objects.order_by('-artist_name')[:10]
  template_name = 'feature/detailgenrenaver.html' 
  context_object_name = 'naver'   
  </code></pre>
  
  <p><code>detailnaver.html</code></p>
  
  <pre><code>&lt;div id="wrapper1"&gt;
  &lt;iframe width="1024" height="500" src="{{ naver.videoid }}" frameborder="0"   allowfullscreen&gt;&lt;/iframe&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><code>navbar.html</code></p>
  
  <pre><code> {% for navloop in naver_set.all %}
   &lt;nav class="navbar" data-tap-toggle="false" role="navigation"&gt;
     &lt;div class="col_2 rightside"&gt;
            &lt;img src="img/rafa.jpg" width="120" height="83"&gt;
            &lt;p&gt;image1&lt;/p&gt;
  
            &lt;img src=naver.videoimage" width="120" height="83" &gt;
            &lt;p&gt;naver.artist_name&lt;/p&gt;
      &lt;/div&gt;
   &lt;/nav&gt;
   {% endfor %}
  </code></pre>
  
  <p><code>urls.py</code></p>
  
  <pre><code>urlpatterns = [
  
  url(r'^$', views.rock_and_feat, name='rock_and_feat'),
  url(r'^trending/(?P&lt;pk&gt;[0-9]+)/$', views.DetailView.as_view(), name='naver'),
  ]
  </code></pre>
  
  <p><code>index.html</code></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;{% include "feature/navbar.html" %}&lt;/head&gt;
  &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My problem is, when I use the <code>for</code> loop in <code>navbar.html</code>, is lists all the objects in <code>Naver</code>, But I want to be able to refer to the objects individually with maybe the id reference like <code>naver.videoimage(id=1)</code> or something like that and without the for loop so that it doesn't list the objects multiple times.</p>