I would like to generate an ID for each entry in my db table. It would look like this: nov45833.
The first three characters are unique to the name of my table, nov for novel, com for comic, etc. The next 5 digits are a randomly generated number. If I wanted to delete the entry, I would simply call the stored ID for the entry (e.g. .../delete/nov45833) to do so. I would also like the IDs to be unique (so I don't delete the wrong entry).
My original plan was to click a button as I'm filling out my form that will generate a random number and show the value in the specified form field. Then I would complete the form as intended. Here is an example: Codepen
Would I have to do this on the server-side or with JavaScript? I am working with Python, particularly Flask. If you have any questions or think this is stupid, please let me know. Thank you. I am quite inexperienced.