简体   繁体   中英

Tastypie Nested Resource URIs

I'm creating an API where I would like to POST and GET the children objects from the parent object. For example:

  • 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
  • POST challenge/1/solution = Add to Solution with challenge_id=1

The solution URLs only return user's submitted solutions. The URLs above are used to access the list of solutions for each challenge.

I need this solution to apply to multiple children objects.

我改用美味的蛋糕

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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