plsql 往视图传参数_如何将参数从一个视图传递到另一个视图

I can't get this to work: I navigate to the page I want, but I'm doing something wrong with the variables it seems.

views.py:

@view_config(http_cache=1,route_name='hoofdpagina', renderer='templates/hoofdpagina.pt')

def hoofdpagina(request):

page = DBSession.query(MyModel) #.filter_by(id='1').all()

if 'form.submitted' in request.params:

name= request.params['name']

page2=Page(name)

DBSession.add(page2)

return HTTPFound(location=request.route_url('view_page',pagename=name))

return dict(page=page)

@view_config(route_name='diagnose', renderer='templates/diagnose.pt')

def diagnose(request):

return request

kak = ['test1','test2','test3t']

content = {"test1","test2","test3"}

return {'content' :content, 'test' :kak}

hoofdpagina.pt:

D Nr.DatumPatientPrior

et werkt slet

I can show all the variables of page in my table. But when I press the submit button I can't get the content of the "name" label to my diagnose page. I don't know how I can show the value.

解决方案

a sollution is working with url dispatching like this:

_init_.py:

config.add_route('diagnose1', '/diagnose1/{dosierid}')

views.py

@view_config(route_name='diagnose1', renderer='templates/diagnose.pt')

def diagnose1(request):

tabeldata=''

dosierid = request.matchdict['dosierid']

now you have your id from one view to another.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值