E
E
Evgeny Akimov2020-11-12 13:42:46
Django
Evgeny Akimov, 2020-11-12 13:42:46

How to use a field that is a Foreign Key for another entity in Django.forms?

5fad10dd1efef661094526.jpeg
5fad10ec3cfb1533728934.jpeg
5fad10f95eed5515938252.jpeg

He swears at the doctor_id field, saying that you can’t just insert a number here, you need exactly "Doctor" instance

Question
How to collect an appointment (doctor's appointment) as a result?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-11-12
@Zenddos

1. names for ForeignKeys are usually given doctor, not doctor_id
2. models should use ModelForm, not Form

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question