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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:47:15+00:00 2026-06-06T02:47:15+00:00

Here is my problem : I have a list of messages which I can

  • 0

Here is my problem :

I have a list of messages which I can filter using a form on the same page. Also, I can display one of the message below the list by clicking on it.

My problem is that if I filter the list and then selects a message to display it, the GET data filtering the list are ‘lost’. So all the messages are displayed in the list again.

How could I display a message and keep the list as it was when I clicked on the message?

My urls:

url(r'^inbox/$', view='inbox', name="kernel-networking-messages-inbox"),
url(r'^inbox/(?P<message_pk>\d+)/$', view='inbox_message', name="kernel-networking-messages-inbox-read"),

My views:

class InboxView(SearchViewMixin):
    template_name = "kernel/networking/messages/inbox.html"
    form_class = InboxForm

inbox = InboxView.as_view()

class InboxMessageView(InboxView):
    def dispatch(self, request, *args, **kwargs):
        self.message = get_object_or_404(Message, pk=kwargs['message_pk'])
        return super(InboxMessageView, self).dispatch(request, *args, **kwargs)

    def get_context_data(self, **kwargs):
        context = super(InboxMessageView, self).get_context_data(**kwargs)
        context['message'] = self.message
        return context

inbox_message = InboxMessageView.as_view()

inbox.html:

<form action="" method="get">
...
<input type="submit" value="Search"/>
<table>
...
</table>
{% if message %}
// display message
{% endif %}

I tried to be as clear as possible :/

  • 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-06T02:47:17+00:00Added an answer on June 6, 2026 at 2:47 am

    I see two options.

    1: Use Django’s session framework.

    When you receive a request for filtering, store the filter options in the session: request.session['filter_options'] = filter_option_dict

    Then, when you load the page and don’t see any filtering options in request.GET, check if there are any options in the session:

    if(len(request.GET) > 0):
        #get filter options from request.GET
        #save filter options to session
    elif('filter_options' in request.session):
        #get filter options from session
    else:
        #no filter options, display without filtering
    

    Note that the session is designed for temporary data, and is specific to one browser on one computer. That’s not a problem for this use case, but it’s something to remember.

    2: Use ajax to load the message without changing the rest of the page. On the server, you create a view that returns a message without the page header or any other formatting, and javascript on the front-end to send requests and insert the retrieved messages into the page. This is very easy with JQuery, although it can be done without.

    This would be my preferred solution, as websites that update themselves interactively feel much nicer from a user’s perspective than one that has to refresh every time they click a link.

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

Sidebar

Related Questions

Here's my problem: I have do create a menu/list of actions (which would be
I need help with CMD scripts. Here is my problem: I have list of
Here is the problem: I have a list of items with various length for
Okay, so here's my problem: I have a list of members on a website,
I have problem adding arraylist to list view, will explain about my problem here..
Here's the problem: I have a data-bound list of items, basically a way for
OK the question title is vague, but here's the problem. I have a list
I have one Activity in which I try to show some simple messages, and
I am using jquery validation plugin to validate my form. I have one field
I have a MySQL table set up using phpMyAdmin which you can view in

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.