예제 #1
0
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")
예제 #2
0
파일: commands.py 프로젝트: allieus/askbot3
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
    })
예제 #3
0
파일: commands.py 프로젝트: allieus/askbot3
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
    })