I would like to implement the add button we have beside a ForeignKey field, so that we can add data to the field/database.
I have been following a couple tutorials, but none of them help me actually add data to the field, and in turn, my database. I have also been looking everywhere but I can't seem to find anyone that has accomplished this task.
A good tutorial I have been following is this one: https://djangopy.org/how-to/reverse-engineering-of-the-django-admin-foreign-keys-addedit-button/
However, the tutorial is very good until the end. He only implements the edit button, and not the add button. So I'm not sure which AJAX call I need to make in order to replicate that of which the admin add button does, when adding data for the ForeignKey.
For the sake of brevity, all code from the tutorial is exactly what I have, I just need to implement a function for the add button.
If anyone has any ideas or could point me into the right direction, that would be greatly appreciated.