M
M
Michael2017-05-22 09:34:16
JavaScript
Michael, 2017-05-22 09:34:16

How to make post edit popup in django?

Hello, the bottom line is this. There are entries that are displayed through a cycle in the template. You need to make sure that when you click on the link, a pop-up window with the form for editing this entry is shown.
The popup window is ready, the function (and class) is also there. But it only works if you go to the edit page.
The question is, how can I make the edit form appear in the window?
As I think, you need to lay out your form and pass data to it in the template.
Maybe there is a better and more correct solution to this problem? That all this would be processed on the server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-05-22
@immaculate

Lots of options. If bootstrap is used and there are few forms, for example, then in the template we push the form into the bootstrap modal, and that's it.
If there are many forms and / or they are very heavy, then we make a separate view that returns only html with the form, without design. On click, we show the bootstrap modal window, into which we load the form using XMLHttpRequest.
If some framework like React is used on the frontend, then we can implement editing through the use of the Django Rest Framework.
In general, it can be implemented in many ways, depending on preferences and requirements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question