B
B
blackbb2016-10-25 21:56:38
Django
blackbb, 2016-10-25 21:56:38

(Django). How to insert a value from another model into the placeholder field in a form?

There are two models Order and Profile. They both have a "phone" field. In the order creation form, you need to insert the value from the "phone" field of the Profile model into the placeholder of the phone field by default. Who knows how to implement it? The whole catch is that in general it would be possible to hide this field and, when saving the form in this field, save the value from the Profile model, but you just need to make it so that the user can change this value in the form.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
blackbb, 2016-10-25
@blackbb

Resolved the issue. I made the form manually and put the value of another model into the placeholder through the User model ({{user.porfile.phone}})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question