def index(request): portfolios = get_portfolios(request) currencies = Currency.all() if request.method == 'POST': form = PositionForm(request.POST) if form.is_valid(): form.save() return HttpResponseRedirect('/') else: form = PositionForm() return shortcuts.render_to_response('index.html', locals())
def currencies(request): Currency.delete_all() Currency.download_all() return redirect(request)