예제 #1
0
파일: views.py 프로젝트: saga/kindledump
def conf_edit(request):
    if request.method != 'POST':
        return HttpResponseRedirect(reverse('userconf-main'))

    username = request.POST.get('kindlename', None)
    if not username:
        return HttpResponseRedirect(reverse('userconf-main'))

    user = users.get_current_user()
    profile = UserConf.gql("WHERE user = :1", user).get()
    if profile is None:
        profile = UserConf(user=user)

    profile.kindle_mail = '*****@*****.**' % username
    profile.put()

    return HttpResponseRedirect(reverse('userconf-main'))
예제 #2
0
파일: views.py 프로젝트: saga/kindledump
def main(request):
    ctx = request.context

    user = users.get_current_user()
    ctx['feeds'] = Feed.gql("WHERE owner = :1", user)
    ctx['conf'] = UserConf.gql("WHERE user = :1", user).get()

    return render_to_response('userconf/main.html', ctx)