I
I
Ilya Korol2019-06-22 19:38:04
Django
Ilya Korol, 2019-06-22 19:38:04

How to make default empty in models ForeignKey?

How to make default empty in models ForeignKey?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-06-22
@welcome32

You can specify that a field may not have a value:

user = models.ForeignKey(User, null=True, blank=True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question