I am creating one model called Profile in which i have to add a url field for telegram profile. It takes username as input, but in output it should look like this: https://t.me/{username}.
How I can create custom model field for this problem. Thanks by the way
My expectation is that, you only enter username, but in output it comes with prefix https://t.me/ and full url path will be https://t.me/{username}
2
Answers
create a function under your model and use it in the template:
or override save function under your model
Create a property function in your profile model.
When accessing the model link on your template or code use: