DEV Community

ThatWokenONE
ThatWokenONE

Posted on

Django Rest Framework - Filter nested one to many

What I want to achieve:

I want a list of users with their respective missions, and filter on missions start date.

# Pseudo json
User 1
  - mission 1
  - mission 2
User 2
  - mission 1
  - mission 2
  - mission 3

My data structure:

Models:

class Mission(models.Model):

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay