'how to define models, validators, expiring URL, by using Following data?

id auto increment Name : source name (unique) mk Desc : small descripton to know about sourc rooturl : domain Name that deployed this tinny url https://tm.py/ Active/Expired: Bool Createdon CreatedBy

Tinny URL tables

id, : auto sourcecode : source table code mk tinnycode : generated 6 digits code ( should be unique for source) A123h5 MainURL : actual url tinnyURL: tinney https://tkm.py/A123h5 validity : no of days valid from created date Createdon : auto createdby : request by RequestFrom : request header info ( Like IP,request url, user etc)

setTinnyURL( Source, actual URL, validity)

soruce :Mk actual URL : https://airbrake.io/blog/python/zerodivisionerror-2#:~:text=As%20you%20may%20suspect%2C%20the,or%20modulo)%20operation%20was%20zero.&text=We'll%20also%20see%20how,handling%20division%20by%20zero%20issues.

validity : 3

log ( "got tinney request for MK soruce", "IP",USr) generate Tunney code 6 unique A123h5

{ status: 200 message": success

response:{
        TinnyURL: "https://tkm.py/A123h5"
}

}

getTinnyURL(tinnyURL) check tinnyurl in Tinny URL tables , value matched in tinnyURL field then retun actualURL



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source