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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:21:15+00:00 2026-06-10T07:21:15+00:00

I have a project that lists a number of items in a certain order.

  • 0

I have a project that lists a number of items in a certain order. This order is determined by two variables that are passed through parameters:

<a class="btn btn-info" href={{ request.path }}?key={{ key }}&orientation={{ orientation }}><i class="icon-wrench icon-large"></i></a>

“key” is the item characteristic, and “orientation” is ascending or descending. The python code handles the ordering of the items that are passed back to the template.

I have another control that needs to pass a time constraint:

<a href={{ request.path }}?time={{ time }}>{{ value }}</a>

Where time is the number of minutes.

The issue here is that if the user clicks the sort link and then clicks the time link, {{ request.path }} will only include the “proper path”, not the additional parameters that had been added.

The first sort click would yield something like

/list/items/?key=importance&orientation=asc

But the second click would return

/list/items/?time=30

Where I instead wanted to return

/list/items/?key=importance&orientation=asc&time=30

Now I could use this instead

<a href={{ request.get_full_path }}?time={{ time }}>{{ value }}</a>

But if the time link is clicked multiple times, I could end up with something like this:

/list/items/?key=importance&orientation=asc&time=30&time=60&time=15

Multiple paremeters of the same type when really I would have wanted to overwrite the original parameter of this type.

How can I resolve this issue. I’d like to retain all parameters that are not of the type being passed by the click link.

  • 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-10T07:21:16+00:00Added an answer on June 10, 2026 at 7:21 am

    You can use this snippet http://djangosnippets.org/snippets/2105/. Example:

    {% load add_get_parameter %}
    <a href="{% add_get_paramater param1='const_value',param2=variable_in_context %}">
        Link with modified params
    </a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list that has two items: projects and groups. Projects can go
I have two sheets. One that lists all of my projects with columns for
I have an ARM project that I'm building with make. I'm creating the list
I'm working on a project that needs to have a list of weekdays. I
I have a project that may be started on local machine with ./manage.py runserver
I have a project that I have divided quite aggressively into different layers. I
I have a project that using some third-party libraries. My questions is how to
I have a project that is displaying 16px text font at 0.5ems links on
I have a project that's been changed and modified in bits and pieces over
I have a project that I've added to my Jenkins server. The project includes

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.