Django tastypie and GenericForeignKey?

There's currently no easy way using generic relations in tastypie. There have been some patches submitted at tastypie github page but these have not been merged as of this writing.

There's currently no easy way using generic relations in tastypie. There have been some patches submitted at tastypie github page but these have not been merged as of this writing. The easiest way to do this, define a contenttype resource and use that for the resources having a generic relation.

Something along the lines of: class ContentTypeResource(ModelResource): class Meta: queryset = ContentType.objects.all() resource_name = "contrib/contenttype" fields = 'model' detail_allowed_methods = 'get', list_allowed_methods = 'get' class PageResource(ModelResource): content_object = fields. ToOneField('myresources. ContentTypeResource', 'content_object') class Meta: queryset = Page.objects.all() resource_name = 'page' Hope this helps.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions