简体   繁体   中英

Manage ListView and CreateView on the same template: how to submit data and update listView without reloading the page?

I want user to be able to add new record form a page and the list of records, that would be on the same page above, be updated without reloading the page (see attached picture below)

For now, solutions I've read are to pass queryset (to display the list of records) in the context of createview

But this way, user will submit, and page reloaded, for each new records... As User may have to enter hundreds of records, it is not a satisfactory solution

so, maybe I should use Ajax to post new records and update the list of records

But I wonder if Django has an in-a-box solution to resolve this problem?

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM