Django: How to query objects immediately after they have been saved from a separate view?
What other fields are there in the model db?
You could add an upload_id, which is set automatically after uploading, send it to the next view, and query for that in the db.
Suppose I want to query and display all the images that the user just uploaded through a form on the previous page (multiple images are uploaded at once, each is made into a separate object in the db).
What's the best way to do this?
Since the view for uploading the images is different from the view for displaying the images, how does the second view know which images were part of that upload? I thought about creating and saving the image objects in the first view, gathering the pks, and passing them to the second view, but I understand that it is bad practice. So how should I make sure the second view knows which primary keys to query for?