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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:11:28+00:00 2026-05-13T23:11:28+00:00

I made in my web a menu using generic_view – simple ‘django.views.generic.list_detail.object_list’ in urls.py

  • 0

I made in my web a menu using generic_view – simple ‘django.views.generic.list_detail.object_list’ in urls.py file.
I would like to set a cookies each time when user chooses one of element of this list [HttpResponse.set_cookie(…)].
What is the best solution? Should I write function in views.py or have you got more simple solution?

Edit 1

This is the fragment of my urls.py:

manufacturer_dict = {
                        'queryset': Manufacturer.objects.all()

                     }

urlpatterns = patterns('',

    url(r'^$', 'django.views.generic.list_detail.object_list', manufacturer_dict),



)

And template: manufacturer_list.html

<ul>
{% for object in object_list %}
    <li><a href="{{object.get_absolute_url}}" title="{{object.name}}">{{object.name}}</a></li>
{% endfor %}
</ul>

I am only using generic_views.

This is list of mobile phone models. I want to remember the users mobile model in the cookie.

  • 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-13T23:11:29+00:00Added an answer on May 13, 2026 at 11:11 pm

    Generic views are simple views that handle a couple of common cases, for example rendering a template when no view logic is needed. In your case, you want to add functionality to your view (i.e. setting a cookie) so you will need to write your custom view. In addition, you should not add view logic in your urls.py (the queryset call), this belongs in views.py

    So the process flow could look like:

    1) Show mobile phone models in template using a form.

    2) When user selects phone model from dropdown menu (or something similar) send phone model to a function in views.py

    3) This function receives the phone model and responds with a cookie containing the phone model.

    However, I am not quite sure why you would want to store the phone model in a cookie.

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

Sidebar

Related Questions

When using PNG files (made with Paint.NET) as background images on my web site,
I am using Microsoft Visual Web Developer 2008 Express. I've made an ASP.NET MVC
I have made a Web page using jquery and php where all files are
I made a simple web service which worked nice with few systems that it
Background I have made a Web Service in Visual Studio, and I'm trying to
I have a web service (WCF or ASMX doesn't matter)... I have made a
I'm debugging someone else's code for a web page that is made with ASP.NET
I made this pacman game using an applet. When the applet finishes loading, it
So i created a web site a long time ago using a designer alot
I'm using ASP.NET Sitemaps with a custom Role Provider to generate a site Menu

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.