예제 #1
0
파일: views.py 프로젝트: an/GTGOnline
def list_members(request):
    name = request.POST.get('name', '')
    if name == '':
        name = request.GET.get('name', '')
    visited = request.POST.getlist('visited[]')
    visited.append(request.user.email)
    members = get_members(request.user, name, visited = visited)
    return HttpResponse(json.dumps(members, indent = 4), \
                        mimetype = "application/json")
예제 #2
0
파일: views.py 프로젝트: an/GTGOnline
def list_members_template(request):
    name = request.GET.get('name', '')
    template = loader.get_template('search_user.html')
    members = get_members(request.user, name)
    context = RequestContext(request, {'email': request.user.email, \
                                       'name': request.user.first_name, \
                                       'members': json.dumps(members), \
                                       'query': '', 'origin': 'group'})
    return HttpResponse(template.render(context))