Skip to content

Commit

Permalink
Now properly sends clearing updates when you set an entry to have no …
Browse files Browse the repository at this point in the history
…flows/no tags/etc. [#5 resolved]
  • Loading branch information
lethain committed Jun 6, 2008
1 parent a9d76a7 commit 4e605fa
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/views.py
Expand Up @@ -172,7 +172,8 @@ def update(request):
vals = dict.getlist(key)
manager = getattr(object, key)
manager.clear()
manager.add(*vals)
if not (len(vals) == 1 and vals[0] == -1):
manager.add(*vals)
object.save()
return HttpResponse("success")

Expand Down
1 change: 1 addition & 0 deletions templates/lifeflow/editor/edit_five.html
Expand Up @@ -20,6 +20,7 @@
function() {},
function() {
var selected = $.map($("a.selected"),function(x) { return x.id; });
if (selected.length == 0) selected.push(-1);
var data = {"series":selected};
update_model("{{model}}",{{object.pk}},data);
});
Expand Down
1 change: 1 addition & 0 deletions templates/lifeflow/editor/edit_four.html
Expand Up @@ -21,6 +21,7 @@
function() {},
function() {
var selected = $.map($("a.selected"),function(x) { return x.id; });
if (selected.length == 0) selected.push(-1);
var data = { "tags":selected };
update_model("{{model}}",{{ object.pk }}, data);
});
Expand Down
1 change: 1 addition & 0 deletions templates/lifeflow/editor/edit_seven.html
Expand Up @@ -49,6 +49,7 @@
function() {},
function() {
var selected = $.map($("a.selected"),function(x) { return x.id; });
if (selected.length == 0) selected.push(-1);
var data = {"authors":selected};
update_model("{{ model }}",{{ object.pk }}, data);
});
Expand Down
1 change: 1 addition & 0 deletions templates/lifeflow/editor/edit_three.html
Expand Up @@ -11,6 +11,7 @@
function() {},
function() {
var selected = $.map($("a.selected"),function(x) { return x.id; });
if (selected.length == 0) selected.push(-1);
var data = {"flows":selected};
update_model("{{model}}",{{object.pk}},data);
});
Expand Down

0 comments on commit 4e605fa

Please sign in to comment.