简体   繁体   English

Tastypie嵌套资源URI

[英]Tastypie Nested Resource URIs

I'm creating an API where I would like to POST and GET the children objects from the parent object. 我创建了一个API,我想POSTGET子女从父对象的对象。 For example: 例如:

  • GET challenge/1/solutions = [Listof Solutions] filtered with challenge_id=1 GET challenge/1/solutions = [Listof Solutions] filtered with challenge_id=1
  • GET challenge/1/solution/1 = Solution with id=1 filtered with challenge_id=1 GET challenge/1/solution/1 = Solution with id=1 filtered with challenge_id=1
  • POST challenge/1/solution = Add to Solution with challenge_id=1 POST challenge/1/solution = Add to Solution with challenge_id=1

The solution URLs only return user's submitted solutions. solution URL仅返回用户提交的解决方案。 The URLs above are used to access the list of solutions for each challenge. 上面的URL用于访问每个挑战的解决方案列表。

I need this solution to apply to multiple children objects. 我需要此解决方案才能应用于多个子对象。

我改用美味的蛋糕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM