Filtering related fields with related_field #916
Replies: 3 comments 3 replies
-
I took some time and now I have a solid thinking that we have to use the related views for related fields.
Currently what I do is this (not optimal and performant, but does the job):
This approach has things to consider:
I'll see if I can clean up the code and have others opinion. |
Beta Was this translation helpful? Give feedback.
-
related urls served by a single viewset is a simple way of adding relationships links. It has its limitation though such as no filter support. Also important to note is that this got added later. The idea was to simplify the process of providing relationships links. Before RelationshipView was actually used for related urls and can still be used today. So if you wanna use filters better switch to With all the complexity and errors related urls served by a single viewset brought I wondered though whether it was a good idea to include this feature. Or maybe there is a better way of simplifying support of related urls then a need to configure each single relationship individuall per resources as currently done with |
Beta Was this translation helpful? Give feedback.
-
I converted this issue to a discussion so it can be further discussed how to move forward or to leave it as it is. Issue can be extracted once there is an agreement on how to. |
Beta Was this translation helpful? Give feedback.
-
How can we filter the related fields
/authors/1/entries/
?Beta Was this translation helpful? Give feedback.
All reactions