title: Problems with getting data from sqlite database django project
body: <p>Recently i have started to learn programming and can't solve one problem. I know that i am doing something wrong, can anybody help me.
  I have Article model, that are connected by a foreingkey to vipusk. Where vipusk is connected to a Year model also by a foreign key. On the top of all is Year model.</p>
  
  <p>I have created couple of articles in my database , random ammount of vipusks and some number of Year. 
  When i am trying to get it directly from the databese i got only some of them, i mean one year contains couple of vipusks, and when i am trying to display number of vipusks, i got only 2 each. But i know that one of year contains 4 vipusks. I think the problem is somewhere in views. But i don't know how to fix it</p>
  
  <p>THis is my viev field:</p>
  
  <pre><code>def arkchive(request):
      latest_year = YearPub.objects.all().order_by('year_alias')
      for i in latest_year:
          latest_vipusks = Vipusk.objects.filter(vipusk_year=latest_year).order_by('id')
          for j in latest_vipusks:
              articles = Article.objects.filter(article_vipusk=latest_vipusks).order_by('id')
  
      args = {}
      args['years'] = latest_year 
      args['vipusks'] = latest_vipusks 
      args['articles'] = articles 
      return render_to_response('arkchive.html', args)enter code here
  </code></pre>
  
  <p>and here is what i am  trying to get in my template</p>
  
  <pre><code>{% for year in years %}
      {{year.yearpub_int}}
      {% for vipusk in vipusks %}
          &lt;a class='title_vipusk'&gt;{{vipusk.vipusk_int}}&lt;/a&gt;
          {% for article in articles %}
              &lt;a class='title_article'&gt;{{article.vipusk_name}}&lt;/a&gt;
          {% endfor%}
      {% endfor %}
  {% endfor %}
  </code></pre>