If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    tom  14 years ago
    I'm working on implementing your cascading_select widget on my custom registration form. This is how my code is ordered: in application\controllers\default.py
    def user():
        return dict(form=auth())
    
    in views\default\user.html
    {{if request.args(0)=='login':}}
    {{=form.custom.begin}}
    {{#table with login custom fields}}
    .
    .
    .
    {{=form.custom.submit}}
    {{=form.custom.end}}
    
    {{elif request.args(0)=='register':}}
    {{=form.custom.begin}}
    {{#table with registration custom fields (for example):}}
    {{=form.custom.label01}}{{=form.custom.widget01}}
    {{=form.custom.label02}}{{=form.custom.widget02}}
    {{=form.custom.label03}}{{=form.custom.widget03}}
    .
    .
    .
    {{=form.custom.submit}}
    {{=form.custom.end}}
    
    In the registration part I'd like to include your cascading_select widget. In my database I have 3 separate tables with state, city and zipcode. During registration I'd like to add id's of this 3 data (selected state, city, and zipcode) to user record. If I understand it correctly in my user_auth table I should have fields like state, city and zipcode. Can you tell me how should I modify my def user(): and registration form to have it working? Or maybe I need to modify something else yet? I'll appreciate your help. Best regards.

Commented on:

This is a collection of widgets I have made together in a sample application.

Hosting graciously provided by:
Python Anywhere