Let's say you have a registration form :

# In the model you have something like that:

class MyAuth(Auth):
auth = MyAuth(globals(), T,db)

 db.define_table(
    auth_user,
    db.Field('user_name', length=128,default=''),
    db.Field('first_name', length=128,default=''),
    db.Field('last_name', length=128,default=''),
    db.Field('email', length=128,default=''),
.....
)


# In the Controller you have something like :
# you can optionally choose the field to display in the from end
using  (writable or readable):

# if I don't want to display the "last_name" field  do this:
    auth.settings.table_user.last_name.writable = False
    auth.settings.table_user.last_name.readable = False

    return dict (regform =  auth.register()   )


# in the front end I can customize as I want this way :
<form>
<table>
            <tr>
               <td>Firstname:</td>
               <td><input name="first_name" type="text"
value="{{=regform.latest.first_name}}"/> </td>
              </tr>
            <tr>
               <td>Email:</td>
               <td><input name="email" type="text"
value="{{=regform.latest.email}}"/> </td>
              </tr>
            <tr>
               <td></td>
               <td><input type="submit" value="Submit" /></td>
             </tr>
</table>

{{=regform.hidden_fields()}}    # This is really important

</form>


So basically you can customize as you want in the front-end and also
in the controller....
I hope this help... Please let us know with a specific example of what
you are trying to do if you this doesn't help you...

Cheers,
Yannick P.


On Sep 18, 2:50 pm, waTR <r...@devshell.org> wrote:
> I am looking to make use of Auth's facilities but implement my own
> registration form. How would one go about creating a completely
> custome registration form while making use of Auth?  I am unable to
> find any documentation on that (not in manual).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to