context = {
'object': self.get_object(),
}
+ print "get context for NoteSaveView"
return super(NoteSaveView, self).get_context_data(**context)
def get_success_url(self):
"""
self.object = self.get_object()
self.object.name = form.cleaned_data['name']
- self.object.desc = form.cleaned_data['desc']
+ self.object.year = form.cleaned_data['year']
# use *arg expansion to pass tags a list of tags
self.object.tags.add(*form.cleaned_data['tags'])
self.object.save()
def form_invalid(self, form):
""" Do stuff when the form is invalid !!! TODO """
+ print "running form_invalid"
print self.form
print self.form.errors
onComplete: function( id, fileName, responseJSON ) {
if( responseJSON.success ) {
// activate the form for submitting
- $('form#upload_form').attr('action', responseJSON.note_url);
+ $('form#add-note').attr('action', responseJSON.note_url);
// inform the user of success
$('#add-note-status').text('Uploaded');
// TODO: activate the save button
$('#save-btn').removeClass('disabled');
+ // add the save url to form as ACTION
+
// add a click handler to submit the add-note form
$('#save-btn').click(function(){
$('form#add-note').submit();