我抽查了几吨推土器,但其中每一个都告诉你这样做的一种方式,其中没有一个是简单的,而我是混淆不清的,因为我从未与阿富汗复兴共和军合作。
I have a model called "note", a modelform for it, and inside the template I need that everytime a note element sends the stop() signal (from jQuery Sortables) django updates the object.
我目前的法典:
<>views.py
def save_note(request, space_name):
"""
Saves the note content and position within the table.
"""
place = get_object_or_404(Space, url=space_name)
note_form = NoteForm(request.POST or None)
if request.method == "POST" and request.is_ajax:
msg = "The operation has been received correctly."
print request.POST
else:
msg = "GET petitions are not allowed for this view."
return HttpResponse(msg)
JavaScript:
function saveNote(noteObj) {
/*
saveNote(noteObj) - Saves the notes making an AJAX call to django. This
function is meant to be used with a Sortable stop event.
Arguments: noteObj, note object.
*/
var noteID = noteObj.attr( id );
$.post("../save_note/", {
noteid: noteID,
phase: "Example phase",
parent: $( # + noteID).parent( td ).attr( id ),
title: $( # + noteID + textarea ).val(),
message: "Blablbla",
});
}
现行代码从模板中获取数据,并在终端中打印。 我不知道我如何操纵这一数据。 我看到一些人通过分类管理数据,将数据发送到 d。
我如何能够查阅美国宇宙航空研究开发机构提供的数据,并更新说明标的?