C
C
cromvwell2020-09-28 11:41:44
Django
cromvwell, 2020-09-28 11:41:44

How to insert text into a form?

There is an article. I want to make it possible to edit it by pressing the edit button, and you will have text fields with the article data in which you can make edits (I hope I explained it clearly). So, tell me how to insert data into text fields?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2020-09-28
@AstraVlad

When you create an edit form, you pass it the object you want to edit:
form = ArticleForm(instance=article_object)

D
Dr. Bacon, 2020-09-28
@bacon

https://docs.djangoproject.com/en/3.1/topics/forms...
https://docs.djangoproject.com/en/3.1/topics/forms...
PS with questions like this django is not for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question