From 68487c846b44c47668c8f2a7e411ae80c16df58f Mon Sep 17 00:00:00 2001 From: Craig Blaszczyk Date: Fri, 22 Jul 2011 14:35:05 +0100 Subject: [PATCH] update list URL to not match instead of the change url --- djangorestframework/builtins.py | 2 +- djangorestframework/serializer.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/djangorestframework/builtins.py b/djangorestframework/builtins.py index 7bbb1f4cf..3056b2880 100644 --- a/djangorestframework/builtins.py +++ b/djangorestframework/builtins.py @@ -73,7 +73,7 @@ class DjangoRestFrameworkSite(object): prefix += '/' if issubclass(view, ListModelMixin): urlpatterns = patterns('', - url(r'^%s%s/' % (prefix,resource_name), + url(r'^%s%s/$' % (prefix,resource_name), view.as_view(resource=resource), name=resource_name ) diff --git a/djangorestframework/serializer.py b/djangorestframework/serializer.py index 22efa5ed3..ce5e343de 100644 --- a/djangorestframework/serializer.py +++ b/djangorestframework/serializer.py @@ -143,7 +143,10 @@ class Serializer(object): def get_related_serializer(self, key): - info = _fields_to_dict(self.fields).get(key, None) + fields = _fields_to_dict(self.fields) + fields.update(_fields_to_dict(self.include)) + info = fields.get(key, None) + # If an element in `fields` is a 2-tuple of (str, tuple) # then the second element of the tuple is the fields to