Ajax-如何自动保存我的Django表单 [英] Ajax - How to save automatically my Django form

查看:107
本文介绍了Ajax-如何自动保存我的Django表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的django应用程序下有一个add_form.我想在此表单中添加一项功能,该功能可以在用户开始键入后自动保存表单.

i have an add_form under my django app. i want to add a feature this form which is saving form automatically after user starts to type.

就像gmail或博客一样.

like in gmail , or blogger.

我应该遵循什么步骤?哪种方式或插件?以及如何使用它们?

what are the steps i should follow? which way or plugin? and how to use them?

任何知识都可以帮助我.谢谢.

any knowlenge can help me.thank you.

推荐答案

有两个有用的jquery插件可以帮助您入门

There's two useful jquery plugins to get you started

https://github.com/BenGriffiths/jquery-save-as-您输入,它将您在本地输入的内容保存到Cookie客户端.使用此插件更简单,您只需要在用户点击表单的保存"按钮时将其实际保存到django后端即可.

https://github.com/BenGriffiths/jquery-save-as-you-type which saves what you type locally to a cookie client-side. Using this plugin is simpler and you will only need to actually save into your django backend when the user hits your form's "save" button.

https://github.com/nervetattoo/jquery-autosave ,需要您进行设置在Django中建立一个中间模型(也许是Draft模型)来跟踪更新.当用户最终点击保存时,数据的最终副本将被保存到实际模型中.

https://github.com/nervetattoo/jquery-autosave which requires that you set up an intermediary model (perhaps a Draft model) in django to keep track of updates along the way. And when the user finally hits save, a final copy of the data is then saved into the actual model.

这篇关于Ajax-如何自动保存我的Django表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆