#33035: Autocomplete and populating Subcategories based on selected Categories
(Admin and Forms)
-------------------------------------+-------------------------------------
     Reporter:  Jon Levischi         |                    Owner:  Jon
                                     |  Levischi
         Type:  New feature          |                   Status:  assigned
    Component:  Forms                |                  Version:  3.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
  autocomplete_fields,               |  Unreviewed
  limit_choices_to                   |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  1
-------------------------------------+-------------------------------------
Description changed by Jon Levischi:

Old description:

> A combination of the recently implemented "autocomplete_fields" 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!

New description:

 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!

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33035#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.20403693c15b610877f395efeb4af1d8%40djangoproject.com.

Reply via email to