Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8681457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:30:53+00:00 2026-06-12T21:30:53+00:00

My views are not rendering correctly. I have the same format for both views

  • 0

My views are not rendering correctly. I have the same format for both views (index.html and mq.html), and index.html is working fine– it creates a bulleted list with 1 value for each bullet.

However, mq.html creates the correct number of bullets, but the words don’t show up on the page. Can anyone tell me what’s wrong with the code? Models, Views, and HTML below.

Models:

class Movie(models.Model):
    title = models.CharField(max_length = 500)
    pub_date = models.DateTimeField('date published')
    def __unicode__(self):
        return self.title
    def was_published_recently(self):
        return self.pub_date >= timezone.now() - datetime.timedelta(days=1)

class Question(models.Model):
    movie = models.ForeignKey(Movie)
    question_text = models.CharField(max_length = 1000)
    def __unicode__(self):
        return self.question_text

Views:

def index(request):
    r = Movie.objects.all().order_by('-pub_date')
    return render_to_response('mrt2/index.html', {'latest_movie_list': r})

def movie_questions(request, movie_id):
    p = Movie.objects.get(pk=movie_id)
    k = Question.objects.filter(movie=p)
    return render_to_response('mrt2/mq.html', {'movie':p, 'the_question':k})

HTML:

index.html

<h1> Test </h1>

{% if latest_movie_list %}
    <ul>
    {% for movie in latest_movie_list %}
        <li><a href="/movie/{{ movie.id }}/">{{ movie.title }}</a></li>
    {% endfor %}
    </ul>
{% else %}
    <p>No movies are available.</p>
{% endif %}

mq.html

{{ movie.title }}

{% if the_question %}
    <ul>
    {% for each in the_question %}
        <li><a href="/movie/{{ movie.id }}/{{ question.id }}/">{{ question.question_text }}</a>    </li>
    {% endfor %}
    </ul>
{% else %}
    <p>No questions have been asked.</p>
{% endif %}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:30:54+00:00Added an answer on June 12, 2026 at 9:30 pm

    Your for each loop is not assigning anything to a question.

    This:

    {% for each in the_question %}
    

    Needs to be:

    {% for question in the_question %}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

django-userena does not have a views.py file. It uses instead html files, i would
I have a View controller displaying some information (not table views). I have an
My form views fine in IE7 and IE8 but FireFox does not display the
I tried the following: $.load(Views/chatBox.html).appendTo('body') Console Output: TypeError: $.load is not a function EDIT
I have a usercontrol that is rendering a list of items. Each row contains
I am having a problem the Backbone.js View not rendering. My code is fairly
I am inflating Views (not fragments) in my viewpager implementation. My main class extends
I'm using Ember 0.9.8.1 and having an issue with nested views not retaining the
It is not a programming question, but need your views in few words. When
I have an ASP.NET WebForms control (derived from Control, not WebControl, if it helps)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.