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

  • SEARCH
  • Home
  • 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 6065371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:22:58+00:00 2026-05-23T09:22:58+00:00

I am having an odd problem… This code was working fine until I worked

  • 0

I am having an odd problem… This code was working fine until I worked on some of the other views, and now, it isn’t working.

Here is my view:

def showTickets(request, project_slug):
    project = Project.objects.get(slug=project_slug)
    tickets = Ticket.objects.get(project=project)
    payload = { 'project':project, 'tickets':tickets}
    return render(request, 'project/tickets.html', payload)

Template:

{% extends 'project/base.html' %}

{% block title %}Tickets: {{project.name}}{% endblock %}

{% block main %}

<div id="project-nav">
    <span><a href="/project/{{project.slug}}/">Tickets</a></span>
    <span><a href="/book/{{book.slug}}{{book.name}}">Docs</a></span>
    <span><a href="/project/{{project.slug}}/browse">Browser</a></span>
</div>
<div id="action-nav">
    {% block actions %}
    <span><a href="/project/{{project.slug}}/tickets/create">Create Ticket</a></span>
    <span><a href="/project/{{ project.slug }}/tickets/recent/">Recent Activity</a></span>
    <span><a href="/project/{{ project.slug }}/tickets/my/">My Tickets</a></span>
    {% endblock %}
</div>
{% for ticket in tickets %}


<div class="ticket">
    <div class="ticket-header">
        <div class="ticket-title">
            <a href="/project/ticket/{{ticket.pk}}">{{ticket.subject}}</a>
        </div>
        <div id="ticket-number">
            #{{ticket.pk}}
        </div>
        <div id="ticket-state">
            {{ticket.get_state_display}}
        </div>
        <div id="ticket-info">
            Reported by {{ticket.created_by}} | created: {{ticket.created_on }} | modified: {{ticket.modified_on}}
        </div>
    </div>
</div>
{% endfor %}
</div>

{% endblock %}

Error:

Template error:
In template c:........\project\tickets.html, error at line 19
   Caught TypeError while rendering: 'Ticket' object is not iterable

This was working fine until I worked on some other views…not sure why it isn’t working now? If any one can help I’d appreciate it!

  • 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-05-23T09:22:58+00:00Added an answer on May 23, 2026 at 9:22 am
    project = Project.objects.get(slug=project_slug) 
    tickets = Ticket.objects.get(project=project) 
    

    These two lines are the cause of your troubles. They aren’t returning an iterable, such as a list, but an object, which isn’t iterable at all. Instead of a get, use a filter instead, which will return a list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a bit of an odd problem while trying to compile some code
I am having an odd problem with jQuery 1.5.2 in Chrome. I have code
Currently having this really odd problem with my layout IE7. I'm not very experienced
I've been having an odd problem with some queries that depend on a sub
Disclaimer: this is a (frustrating) homework related problem. I'm having odd results when I
I am having an odd problem with my SQL Server express 2005 DB. It
I am having a really odd problem with Flash CS4. I have a MovieClip
Can anyone help with an odd Ruby Gem problem I'm having - note I've
I'm having an odd probably with rails right now... a class is being defined
I'm having a rough time with this membership stuff. OK, so, it's really odd.

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.