Yes you can make a normal charfield and assign its default attribute to a function you declare
On Wed, 6 May 2020, 6:53 pm Anselme SERI, <[email protected]> wrote: > Hi, > > I use Django 3.0 and I would like to create a function which fill > automatically a field in my models. > Can I do it directly in models.py ? How? > > Thanks a lot > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-dDRD%3DLteuDo7KuATzjKem-ThvtozzHuaqkwAeAC%2BBrZw%40mail.gmail.com.

