Let’s say I have an user registration form. In this form, I have the option for the user to upload a photo. I have an User table and Photo table. My User table has a “PathToPhoto” column. My question is how do I fill in the “PathToPhoto” column if the photo is uploaded and inserted into Photo table before the user is created? Another way to phrase my question is how to get the newly uploaded photo to be associated to the user that may or may not be created next.
I’m using python and postgresql.
To make sure we’re on the same page, is the following correct?
If so, you should be able to store the “path to photo” information in a Python variable until the user submits the form, and then use the value from that variable in your User-table insert.