示例#1
0
文件: views.py 项目: bmander/proje
def project(request, context, id):
    project = Project.get_by_id(int(id))
    context['project']=project
    
    scraps = Scrap.all().filter("project =", project).order("-created")
    context['scraps'] = scraps
    
    return render_to_response( "project.html", context )
示例#2
0
文件: views.py 项目: bmander/proje
def feed(request, nickname):
    nickname = Nickname.all().filter("nickname =", nickname).get()
    
    if nickname is None:
        return HttpResponseNotFound( "No such user" )
        
    scraps = Scrap.all().filter("creator =", nickname.user).order("-created").fetch(50)
    
    return render_to_response( "feed.xml", {'user':nickname.user, 'scraps':scraps}, mimetype="application/rss+xml" )