From 9ea6a331dddcd28740e3afb9409bf307f48dc6cb Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 4 Dec 2012 20:23:07 +0000 Subject: [PATCH] Removed redundant override_urls call from base api resource. --- spa/api/v1/BackboneCompatibleResource.py | 14 +------------- spa/api/v1/MixResource.py | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/spa/api/v1/BackboneCompatibleResource.py b/spa/api/v1/BackboneCompatibleResource.py index f0ee5c6..9ae8086 100644 --- a/spa/api/v1/BackboneCompatibleResource.py +++ b/spa/api/v1/BackboneCompatibleResource.py @@ -2,18 +2,6 @@ from django.conf.urls import url from tastypie import fields from tastypie.resources import ModelResource -__author__ = 'fergalm' class BackboneCompatibleResource(ModelResource): - def override_urls(self): - urls = [] - for name, field in self.fields.items(): - if isinstance(field, fields.ToManyField): - resource = r"^(?P{resource_name})/(?P<{related_name}>.+)/{related_resource}/$".format( - resource_name=self._meta.resource_name, - related_name=field.related_name, - related_resource=field.attribute, - ) - resource = url(resource, field.to_class().wrap_view('get_list'), name="api_dispatch_detail") - urls.append(resource) - return urls \ No newline at end of file + pass \ No newline at end of file diff --git a/spa/api/v1/MixResource.py b/spa/api/v1/MixResource.py index 13a162b..04fa9da 100644 --- a/spa/api/v1/MixResource.py +++ b/spa/api/v1/MixResource.py @@ -10,7 +10,7 @@ from spa.models.Mix import Mix class MixResource(BackboneCompatibleResource): - comments = fields.ToManyField('spa.api.v1.CommentResource.CommentResource', 'comments', 'mix', null=True) + comments = fields.ToManyField('spa.api.v1.CommentResource.CommentResource', 'comments', 'mix', null=True, full=True) class Meta: queryset = Mix.objects.filter(is_active=True)