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 8539339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:20:33+00:00 2026-06-11T11:20:33+00:00

I for whatever reason cannot duplicate this issue locally but on my production server

  • 0

I for whatever reason cannot duplicate this issue locally but on my production server in one of my templates the regroup tag is doing something odd. I’m trying to group all donations that have the same pickup_id and just display how many of them were “missed”. For some reason it’s showing the same pickup_id more than once in my list.

view

missed_routes = Donor.objects.filter(missed='YES').order_by('pickup_date')  

template

{% block content %}
{% regroup missed_routes by pickup_id as missed_pickups %}

<div class="missedColumn">
    <h2>Missed Donations</h2>
    <p>Looks like we have some stragglers…</p>
    <p>These routes have missed donations in them.</p>
    {% for routes in missed_pickups %}

        <p><a href="/reschedule/{{ routes.grouper }}">{{ routes.list.0.route }}</a> - {{ routes.list.0.pickup_date }} ({{ routes.list|length }} missed - {{ routes.list.0.pickup_id }}</p>
    {% endfor %}
</div>

resulting html # the 600 is the pickup_id

        <p><a href="/reschedule/600">Syosset</a> - Sept. 14, 2012 (1 missed - 600</p>


        <p><a href="/reschedule/423">Huntington Station</a> - Sept. 14, 2012 (1 missed - 423</p>


        <p><a href="/reschedule/600">Syosset</a> - Sept. 14, 2012 (2 missed - 600</p>

When iterating over each donor in a pickup html output

        <p><a href="/reschedule/600">Syosset</a> - Sept. 14, 2012 (1 missed - 600
        <ul>

            <li>134170</li>

        </ul>
        </p>


        <p><a href="/reschedule/423">Huntington Station</a> - Sept. 14, 2012 (1 missed - 423
        <ul>

            <li>134938</li>

        </ul>
        </p>


        <p><a href="/reschedule/600">Syosset</a> - Sept. 14, 2012 (2 missed - 600
        <ul>

            <li>134174</li>

            <li>133151</li>

        </ul>
  • 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-11T11:20:34+00:00Added an answer on June 11, 2026 at 11:20 am

    The problem is that Django’s regroup depends on the list being ordered by the attribute you’re regrouping by. See the docs:

    Note that {% regroup %} does not order its input! Our example relies on the fact that the cities list was ordered by country in the first place. If the cities list did not order its members by country, the regrouping would naively display more than one group for a single country

    Thus, change:

    missed_routes = Donor.objects.filter(missed='YES').order_by('pickup_date')  
    

    to

    missed_routes = Donor.objects.filter(missed='YES').order_by('pickup_id')  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get this image uploading script right, but for whatever reason it
I have done this before, but for some reason cannot get it to work
On whatever reason this is not working (says 'file not found'), set in=c:\myprogram\_save cd
Please check this page: http://islandhideaway.weebly.com/ For whatever reason, the flash slideshow moves over 1
First, apologies,this should be simple but I've had too much coffee and cannot wrap
...which I cannot seem to figure out, for whatever reason. I've tried cleaning my
for whatever the reason i cannot seem to get the syntax right. How do
For whatever reason, I cannot fully understand how position and float work together. I'm
I cannot figure out json for whatever reason, i don't understand why i cannot
For whatever reason, I cannot get knockout to trigger an update on visible whenever

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.