Opened 3 years ago
Last modified 3 years ago
#33035 closed New feature
Autocomplete and populating Subcategories based on selected Categories (Admin and Forms) — at Version 3
Reported by: | Jon Levischi | Owned by: | Jon Levischi |
---|---|---|---|
Component: | Forms | Version: | 3.2 |
Severity: | Normal | Keywords: | autocomplete_fields, limit_choices_to |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | yes |
Description (last modified by )
A combination of the recently implemented "autocomplete_fields" (awesome btw!) with dynamic "limit_choices_to" that actually works on Foreign AND ManyToMany fields both on Admin site and Custom Forms.
class Project categories = M2M [having "Cat A", "Cat B", "Cat C", "Cat D", etc.] subcategories = M2M [having "Sub A1", "Sub A2", "Sub B1", "Sub B2", "Sub C1", "Sub C2", etc.]
When selecting Cat A in the category it would populate subcategory limiting options to "Sub A1", "Sub A2", "Sub C1", "Sub C2", based on their parents, but not "Cat B" nor "Cat D" children).
I know this is possible using Ajax, django-autocomplete-light or similar, but it's so frequently used that I think it makes sense to be included in Django itself.
Thank you!
Change History (3)
comment:1 by , 3 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 3 years ago
Description: | modified (diff) |
---|
comment:3 by , 3 years ago
Description: | modified (diff) |
---|