Commits

David Larlet committed c2d5c46

Allow nested resources

Comments (0)

Files changed (1)

generic/rest_views.py

 from responders import *
 
 try:
-    from django.views.generic.base import BaseDetailView
+    from django.views.generic.base import BaseView
 except ImportError:
-    from compatability import BaseDetailView
+    from compatability import BaseView
 
 def django_authentication(request, **kwargs):
     return request.user.is_authenticated()
 
 
 
-class ModelView(BaseDetailView):
+class ModelView(BaseView):
     """
     ModelView: a RESTful class-based view of your resources
     =======================================================
     def __init__(self, queryset, slug_field='slug', post_save_redirect=None,
             paginate_by=None, allow_empty=True,
             responders=(HtmlResponder,), methods=('GET', 'POST', 'PUT', 'DELETE')):
+        self.slug_field = slug_field
         self.post_save_redirect = post_save_redirect
         self.paginate_by = paginate_by
         self.allow_empty = allow_empty