filter-by support on form collections? #248
codematsing
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Jacob!
It's been a long time! I've checked on the items I've mentioned before when we met and it looks like they've been resolved after I've updated the version I've been using. The only thing I haven't done is to check on django-filer.
On another note, I'd like to ask if you think there's some flexibility to support filter by on fomcollections? I have a particular use case in need of this but I also think that it is a general usecase to consider.
For example, in reference to the
StateandCountyrelationship. Someone may have a usecase to create a company directory where a companies are restricted to operate on particular states only. Consequently, they may open multiple branches on different counties. Here, we might want to construct a FormCollection such as:Processing the code:
I've been reading through the following references for the use of filter-by:
I followed that for the backend (py) code:
I followed also that for the frontend (ts) code:
I'm still trying to digest the code fully but I wonder if you see a way to create an even listener for onChange of field
company_form.state, and to trigger buildFetchQuery that would look something like:<url>?offset=0&filter-state=##&field=branch_formset.0.branch?or would this be complicating things and you see a different approach to filtering options within a formset based on another form?
I also wonder if the use of django_filter's
FilterSetcould resolve this issue but I'm still studying the implementation for this as I think there is a gap in the documentation that does not fully explain how thestate: forms.ModelChoiceFieldvalue is passed to theStateFilterSet.qsAll reactions