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 django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-dDRD%3DLteuDo7KuATzjKem-ThvtozzHuaqkwAeAC%2BBrZw%40mail.gmail.com.
Thanks you for your answer. I know how to make a default value in charfield but I don't know how to build function which returns value for my default field. In my case this function must retrieve last id on my model and must concataned it with a string and the final result must be affected to default charfield. Have you an example ? Help me plz.
Le mer. 6 mai 2020 à 18:44, Motaz Hejaze <trap...@gmail.com> a écrit :
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, <anselme...@gmail.com> 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 django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f810453-c7ca-4c10-bca1-4cfe11ea496a%40googlegroups.com.
--
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...@googlegroups.com.
On 7 May 2020, at 8:53, Derek <game...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48c4d59e-8241-4739-b8df-feab45a7fa3a%40googlegroups.com.