rohitjain-rj / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Doesn t work on django 1.5 #279

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

We need to change a bit the view.py:

before:
from django.views.generic.list_detail import object_list
...
return object_list(request, queryset, **kwargs)

after:
from django.views.generic.list import ListView
...
?

Original issue reported on code.google.com by sup3rnoo...@gmail.com on 6 Apr 2013 at 12:26

GoogleCodeExporter commented 9 years ago
Monkey patching

# list_detail.py
from django.views.generic.list import ListView

def object_list(request, **kwargs):
    kwargs.pop('template_object_name', None)
    return ListView.as_view(**kwargs)(request)

# __init__.py
import sys

from yourapp import list_detail

sys.modules['django.views.generic.list_detail'] = list_detail

Original comment by maciag.artur on 1 May 2013 at 11:13