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