+@transaction.commit_on_success
+def chunk_mass_edit(request):
+ if request.method == 'POST':
+ ids = map(int, request.POST.get('ids').split(','))
+ chunks = map(lambda i: Chunk.objects.get(id=i), ids)
+ try:
+ stage = Chunk.tag_model.objects.get(slug=request.POST.get('stage'))
+ for c in chunks: c.stage = stage
+ except KeyError: pass
+
+ try:
+ user = User.objects.get(username=request.POST.get('user'))
+ for c in chunks: c.user = user
+ except KeyError: pass
+
+ for c in chunks: c.save()
+ else:
+ raise Http404
+
+