Open Jocelyn-AGORO opened 2 years ago
Hi https://github.com/vitalik/django-ninja/pull/673 seems to add this feature. Would you mind taking a look?
@Jocelyn-AGORO
Just be carefull never expose all GET params into orm filter as some one can explore database by querying some related data
overal #673 should give you option to expose OpenAPI params to query nicely from database
Sometimes it could be helpful to have django fields lookup in the url as query params. It help make very cool things. example if I need to filter on a specific model, like user: http://localhost:8000/users?username__startswith=a or http://localhost:8000/users?username__startwiths=a&email__endswith=@gmail.com Or on order model supposing user has orders http://localhost:8000/orders?user__username=vitalik or http://localhost:8000/orders?user__username=vitalik&purchase__gte=2022-01-01