예제 #1
0
def GDocsView(request):
    accounts = DocAccount.all().get()
    user = accounts.email
    password = accounts.password
    client = gdata.docs.client.DocsClient(source='ohsc98lab2')
    client.ClientLogin(user, password, client.source);  
    feed = client.GetDocList()
    return render_to_response('admin/archive/gdocs_view.html',
                              {'feed' : feed})       
예제 #2
0
def GDocsLogin(request):
    if request.method == "POST":
        key = request.POST.get('key', None)
        user = request.POST.get('email', None)
        password = request.POST.get('password', None)
        if user and password:
            if key:
                a = DocAccount.get(key)
                a.email = user
                a.password = password
            else:
                a = DocAccount(email=user, password=password)
            
        a.put()
        return redirect('/admin/archive/gdocs/view/')
    else:
        accounts = DocAccount.all()
        return render_to_response('admin/archive/gdocs_login.html',
                                  {'account' : accounts.get()})