It depends whether you want it on the front end or backend : for front end have a function thats add the above abbreviations before inserting the data into the form. assuming the form has all the variables (school, year, dept, 0213) parse this to the function then it returns registration number .
if its in the admin section you may create a function within the model class and use super to return registration number before saving. On Thursday, 6 April 2023 at 04:42:30 UTC+3 chen...@gmail.com wrote: > Good day all > > I am new to django and I need assistance where I can make a unique > registration number via model with the following format > > *ch2023ed0213* where > > *'ch'* stands for abbreviated school name, > *'2023'* year of programme, > *'ed'* for department and > *'0213'* student unique number.. > > Urls Link or recorded tutorials are welcome. > > Thank you > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7cbedd70-d1e5-4c1a-9faf-7a08d9ad487fn%40googlegroups.com.