django-admin-flexselect
django-admin-flexselect copied to clipboard
Prepopulate when there's already a default?
Hi, thanks for flexselect! It's definitely the cleanest solution to django admin chained selects around.
If I give the triggering field an initial value then I currently have to do a Javascript call to change() manually. Would be great if the trigger fields were checked for an existing value and triggered initially if there was any.
Cheers, Danny
Example: Taking the flexselect example model, this problem occurs when "company_contact_person" is not a required field. Then you can set the "Company", leave "Company contact person" blank, and next time you visit the "Case", the "Company contact person" won't be filtered by the company that is already selected.
class Case(m.Model):
client = m.ForeignKey(Client)
company_contact_person = m.ForeignKey(CompanyContactPerson, null=True, blank=True)