{"issue":{"state":"closed","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/21d365c35c782bb32dd69d522a8a71e0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"21d365c35c782bb32dd69d522a8a71e0","url":"https://api.github.com/users/imjuni","login":"imjuni","id":1166575},"milestone":null,"labels":[],"assignee":null,"updated_at":"2011-11-13T02:53:10Z","comments":2,"closed_at":"2011-11-13T02:53:10Z","url":"https://api.github.com/repos/toastdriven/django-tastypie/issues/277","body":"Hello, I am development my web service.\r\n\r\nI create recursive model. Example below, \r\n\r\nclass Article(models.Model):\r\n    date = models.DateField()\r\n    parent = models.ForeignKey('self', null=True, blank=True, related_name='subarticles')\r\n\r\nArticle is a recursive model. It is a have recursive reference. I want service that model.\r\n\r\nclass ArticleResource(ModelResource):\r\n    class Meta():\r\n        queryset = Article.objects.all()\r\n        resource_name = \"Articles\"\r\n    parent = fields.ToOneField('self', \"Articles\")\r\n\r\nBut, That is invalid syntax and do not executable. I try,\r\n\r\nfields.ToOneField(ArticleResource, \"Articles\")\r\n\r\nIt is same. Because Article is not register at namespace.\r\n\r\nRecursive Model don't support until now? Or Do i try wrong method? Please reply for me. thank.","html_url":"https://github.com/toastdriven/django-tastypie/issues/277","title":"Not support Recursive Model","number":277,"id":2118331,"created_at":"2011-11-02T05:22:17Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/130de5dce3445b62f84fb4cfc86bfcd4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"130de5dce3445b62f84fb4cfc86bfcd4","url":"https://api.github.com/users/toastdriven","login":"toastdriven","id":2449},"updated_at":"2011-11-13T02:53:09Z","url":"https://api.github.com/repos/toastdriven/django-tastypie/issues/comments/2720588","body":"Doing the following should work:\r\n\r\n    class ArticleResource(ModelResource):\r\n        parent = fields.ToOneField('self', 'parent')\r\n\r\n        class Meta():\r\n            queryset = Article.objects.all()\r\n            resource_name = \"Articles\"\r\n\r\nRecursive support is present (https://github.com/toastdriven/django-tastypie/blob/master/tests/core/tests/resources.py#L2265-2288) as long as you haven't added ``full=True`` on the field, which is what @revolunet was referring to.","id":2720588,"created_at":"2011-11-13T02:53:09Z"}}