开发者

web2py - load part of data

开发者 https://www.devze.com 2022-12-10 20:30 出处:网络
i have table called \"type\" which contains data \"family,individual\" i want in some pages load individual only into type drop-down and in another pages load bo开发者_Python百科th

i have table called "type" which contains data "family,individual" i want in some pages load individual only into type drop-down and in another pages load bo开发者_Python百科th

How can i do that??

Thanks in advance


Yes. You can set the default in the model:

db.yourtable.yourfield.requires=IS_IN_SET(('family','individual'))

In any action you can do

db.yourtable.yourfield.requires=IS_IN_SET(('family'))
0

精彩评论

暂无评论...
验证码 换一张
取 消