def frontend(request): if request.subdomain == 'me': return my_profile(request) else: if request.user.is_authenticated() and not request.user.is_anonymous(): return redirect('index') else: return {'profile':User.objects.get(pk=1).profile}
def todo_done(request, todo_id): todo = ToDo.objects.get(pk=todo_id) if todo.done: todo.done = False else: todo.done = True todo.save() return redirect('index')
def todo_done(request, todo_id): todo = ToDo.objects.get(pk=todo_id) if todo.done: todo.done = False else: todo.done = True todo.save() return redirect("index")
def frontend(request): if request.subdomain == 'me': return my_profile(request) else: if request.user.is_authenticated() and not request.user.is_anonymous(): return redirect('index') else: return {'profile': User.objects.get(pk=1).profile}
def request_invite(request): if request.method == 'POST': form = requestInvitation(data=request.POST) if form.is_valid(): inviteRequest(email=form.cleaned_data['email'], about=form.cleaned_data['about']).save() return redirect(request_invite_complete) else: return {'form': form} else: form = requestInvitation() return {'form': form}
def my_route(request, url): return redirect('http://%s/%s' % (Site.objects.get_current(), url))
def todo_add(request): if request.method == 'POST': form = TodoForm(data=request.POST) if form.is_valid(): ToDo(text=form.cleaned_data['text']).save() return redirect('index')
def todo_del(request, todo_id): ToDo.objects.get(pk=todo_id).delete() return redirect('index')
def todo_add(request): if request.method == "POST": form = TodoForm(data=request.POST) if form.is_valid(): ToDo(text=form.cleaned_data["text"]).save() return redirect("index")
def todo_del(request, todo_id): ToDo.objects.get(pk=todo_id).delete() return redirect("index")