#view: def edit_app_browser(request, app_name): print request.POST browsers = Browser.objects.all() app = Application.objects.get_or_create(name=app_name)[0] if request.POST: for b in browsers: if request.POST.get(unicode(b)) == 'Add': app.browsers.add(b) if request.POST.get(unicode(b)) == 'Remove': app.browsers.remove(b) stuff = {} stuff["app_name"] = app_name stuff['supported_browsers'] = [ b for b in app.browsers.all() ] stuff['not_supported_browsers'] = [ b for b in browsers if b not in app.browsers.all() ] return render_to_response("edit_app_browsers.html", stuff) # template: {% for sb in supported_browsers %}
"{{ app_name }}" application supports "{{ sb }}" web browser. {{ sb }} web browser support.

{% endfor %} {% for nsb in not_supported_browsers %}

"{{ app_name }}" application does not support "{{ nsb }}" web browser. {{ nsb }} web browser support.

{% endfor %}