def default(request): if 'ping_location' in request.GET: request.user.location_from_fireeagle( fe ) request.session['flashmessage'] = "Updated location" return HttpResponseRedirect( "/" ) title = "Something is" return render("home.html", request, locals())
def user(request, username): username = decode_uri(username) user = User.by_username( username ) if not user: raise Http404("unknown user") title = user.name events = user.events() center = user flickr_tag = "herejustnow:user=%s"%user.username zoom = 10 return render("map.html", request, locals())
def witness(request): if request.method == 'POST': form = WitnessForm( request.POST ) if form.is_valid(): event = request.user.here_just_now( form.cleaned_data['name'] ) return HttpResponseRedirect( "/event/%s"%( event.key() ) ) elif 'name' in request.GET: form = WitnessForm( request.GET ) else: form = WitnessForm() title = "Something new" return render("form.html", request, locals() )
def user(request, key): user = db.get( key ) status = None if 'delete' in request.POST: user.delete() return HttpResponseRedirect( "/admin/users/" ) if request.method == 'POST': form = AdminUserForm( request.POST ) if form.is_valid(): form.save( user ) status = "Saved changes to user" else: form = AdminUserForm( user.as_dict() ) return render("form.html", request, { 'form':form, 'status':status } )
def monad(request, name ): monad = Monad.by_slug( name, create = True ) flickr_tag = "herejustnow:monad=%s"%monad.slug events = monad.events() if events: center = events[0] zoom = 10 else: center = user zoom = 12 title = monad.name return render("map.html", request, locals())
def event(request, key): event = Event.by_slug( key ) if not event: raise Http404("unknown event") if 'delete' in request.POST and request.user.key() == event.user.key(): event.delete() request.session['flashmessage'] = "deleted" return HttpResponseRedirect( "/" ) monad = event.monad center = event events = [ event ] flickr_tag = "herejustnow:event=%s"%event.key() title = event.monad.name zoom = 10 return render("map.html", request, locals())
def monad(request, key): monad = db.get( key ) return render("form.html", request, { 'form':form } )
def monads(request): return render("admin/monads.html", request)
def events(request): events = Event.all().order("-created_at").fetch(1000) return render("admin/events.html", request, { 'events':events } )
def users(request): users = User.all().order("username").fetch(1000) return render("admin/users.html", request, { 'users':users } )
def default(request): return render("admin/default.html", request)
def todo(request): filename = os.path.join( ROOT_PATH, "TODO" ) todo = file( filename ).read() return render("todo.html", request, locals() )