[Answer]-Accessing model subclass attributes with django tastypie

1👍

Try this:

class FooResource(ModelResource):
    class Meta:
        queryset = Foo.objects.all()  

    def dehydrate(self, bundle):
        if bundle.data['child_model']=="bar":
            return json.loads(BarResource().dispatch_list(bundle.request).content)
        return bundle

Leave a comment