Beispiel #1
0
def create_db(request):
    pname=request.POST['pname']
    pattrs=request.POST['pattrs']
    pstart_time=request.POST['start_time']
    pend_time=request.POST['end_time']
    p=Project(name=pname,attrs=pattrs,owner=request.user.username,start_time=pstart_time,end_time=pend_time)
    p.save()
    return HttpResponseRedirect(reverse('pro.info',kwargs={"pro_id":p.id}))
Beispiel #2
0
def create_db(request):
    pname = request.POST['pname']
    pattrs = request.POST['pattrs']
    pstart_time = request.POST['start_time']
    pend_time = request.POST['end_time']
    p = Project(name=pname,
                attrs=pattrs,
                owner=request.user.username,
                start_time=pstart_time,
                end_time=pend_time)
    p.save()
    return HttpResponseRedirect(reverse('pro.info', kwargs={"pro_id": p.id}))
Beispiel #3
0
def create_db(request):    
    pname=request.POST['pname']
    pattrs=request.POST['pattrs']
    tenant=api.keystone.tenant_create(request,pname,pattrs,True)
    ptenant=tenant.id
    try:
	api.keystone.add_tenant_user_role(request,ptenant,request.user.id,"97071a638733448c8547b5ac431bfa68")
    except Exception:
	pass
    pstart_time=request.POST['start_time']
    pend_time=request.POST['end_time']
    p=Project(name=pname,attrs=pattrs,owner=request.user.username,start_time=pstart_time,end_time=pend_time,tenant=ptenant)
    p.save()
    return HttpResponseRedirect(reverse('potato.pro'))
Beispiel #4
0
def create_db(request):
    pname = request.POST['pname']
    pattrs = request.POST['pattrs']
    tenant = api.keystone.tenant_create(request, pname, pattrs, True)
    ptenant = tenant.id
    try:
        api.keystone.add_tenant_user_role(request, ptenant, request.user.id,
                                          "97071a638733448c8547b5ac431bfa68")
    except Exception:
        pass
    pstart_time = request.POST['start_time']
    pend_time = request.POST['end_time']
    p = Project(name=pname,
                attrs=pattrs,
                owner=request.user.username,
                start_time=pstart_time,
                end_time=pend_time,
                tenant=ptenant)
    p.save()
    return HttpResponseRedirect(reverse('potato.pro'))