Thanks Annet.

This is the exact plan i was having.. Since i am new to python and web2py
both. Was little stuck..
I also tried checking out code of conf2py.. for registration details...


*Also, are you able to edit details of the user profile.*

Since when i used different tables i was not able to edit other tables..

Adding fields to the auth_user makes it possible, since it is a single
table with profile controller referencing to all fields in the table..



On Tue, May 15, 2012 at 12:11 PM, Annet <[email protected]> wrote:

> Hi Yogesh,
>
> After trying different approaches, I decided to do the following: define a
> table 'Node' and a table 'person' referencing 'node' this gives me the
> opportunity to have a table 'organization' too. All other tables including
> 'address' reference the table 'node'.
>
> I added an extra field 'nodeID' to the auth_user table, I wrote a custom
> registration function, which inserts records in the auth_user, person and
> address table. To prevent the user from entering more than one address of
> the same type I wrote a validator:
>
>  
> db.Address.nodeID.requires=[IS_IN_DB(db,'Node.id','%(id)s'),IS_NOT_IN_DB(db(db.Address.addrType==request.vars.addrType),db.Address.nodeID,error_message='combination
> node and addr type already in database')]
>
> I decided to keep profile and person/address separate, but you could write
> a custom update function for this.
>
> I hope this helps you solve the problem.
>
>
> Regards,
>
> Annet
>

Reply via email to