update list URL to not match instead of the change url

This commit is contained in:
Craig Blaszczyk 2011-07-22 14:35:05 +01:00
parent 8837903f83
commit 68487c846b
2 changed files with 5 additions and 2 deletions

View File

@ -73,7 +73,7 @@ class DjangoRestFrameworkSite(object):
prefix += '/' prefix += '/'
if issubclass(view, ListModelMixin): if issubclass(view, ListModelMixin):
urlpatterns = patterns('', urlpatterns = patterns('',
url(r'^%s%s/' % (prefix,resource_name), url(r'^%s%s/$' % (prefix,resource_name),
view.as_view(resource=resource), view.as_view(resource=resource),
name=resource_name name=resource_name
) )

View File

@ -143,7 +143,10 @@ class Serializer(object):
def get_related_serializer(self, key): 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) # If an element in `fields` is a 2-tuple of (str, tuple)
# then the second element of the tuple is the fields to # then the second element of the tuple is the fields to