Monday, July 30, 2018

How to use multiple ForeignKeys

I'm building a Purchase Order app that uses a ForeignKey for Vendors. I want to be able to use another ForeignKey for invoices once a Vendor is selected. So the choices of Invoices would get filtered based on the users selection of the Vendor. How would I do this in the model? I assume I'd need ajax to load the invoices based on the Vendor in the template? Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3c0e8bfb-30fb-467f-aa2f-58677e203480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment