Django Rest框架深度视图

时间:2015-12-20 13:05:04

标签: django django-rest-framework

如何在Django Rest Framework中设置视图或序列化程序,以便为要添加,修改的深度提供URL 有类别和标签的文章。

/api/article/92285/categories
/api/article/92285/tags

来自以下格式

{
  "article_id": 92285,
  "views": 0,
  "downloads": 0,
  "shares": 0,
  "handle_url": "",
  "title": "Test dataset",
  "defined_type": "dataset",
  "status": "Drafts",
  "published_date": "",
  "description": "Test description",
  "total_size": 0,
  "owner": {
    "id": 13483,
    "full_name": "John  Carter"
  },
  "authors": [
    {
      "first_name": "John ",
      "last_name": "Carter",
      "id": 13483,
      "full_name": "John Carter"
    }
  ],
  "tags": [

  ],
  "categories": [

  ],
  "files": [

  ]
}

0 个答案:

没有答案