def get_thread_shared_groups(request): """returns snippet of html with groups""" thread_id = request.GET["thread_id"] thread_id = IntegerField().clean(thread_id) thread = models.Thread.objects.get(id=thread_id) groups = thread.get_groups_shared_with() data = {"groups": groups} html = render_into_skin_as_string("widgets/groups_list.html", data, request) re_data = simplejson.dumps({"html": html, "groups_count": groups.count(), "success": True}) return HttpResponse(re_data, content_type="application/json")
def get_thread_shared_groups(request): """returns snippet of html with groups""" thread_id = request.GET['thread_id'] thread_id = IntegerField().clean(thread_id) thread = models.Thread.objects.get(id=thread_id) groups = thread.get_groups_shared_with() data = {'groups': groups} html = render_into_skin_as_string('widgets/groups_list.jinja', data, request) return JsonResponse({ 'html': html, 'groups_count': groups.count(), 'success': True })