Hi, 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.