Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-18 Thread ranjith
Is there a way to do it? On Thursday, 17 October 2013 23:08:25 UTC+5:30, ranjith wrote: I just need to insert some records into a table when that table is created. I dont know how to do it. Please help!!! On Thursday, 17 October 2013 12:26:11 UTC+5:30, ranjith wrote: Thanks for the

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-18 Thread 黄祥
yes, can, please do with before insert or after insert and please read the book on dal chapter in before and after callback sub chapter ref: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks and for the example you can see in this forum

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-18 Thread ranjith2041
Thanks. But those callbacks are for insertion and deletion of records in a table. I want a *callback for the creation of a table.* On Fri, Oct 18, 2013 at 6:36 PM, 黄祥 steve.van.chris...@gmail.com wrote: yes, can, please do with before insert or after insert and please read the book on dal

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-18 Thread Dave S
On Friday, October 18, 2013 7:50:43 AM UTC-7, ranjith wrote: Thanks. But those callbacks are for insertion and deletion of records in a table. I want a *callback for the creation of a table.* How often is a table created? Your original message in this thread referred to the auth table,

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-17 Thread ranjith
Thanks for the information. I hope so now I can proceed with that. Also, is there any callbacks for the table creation?? I have a table which will have the three static entries added to it only one time. Now, I am manually inserting the records into the table once the table is created. I want

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-17 Thread ranjith
I just need to insert some records into a table when that table is created. I dont know how to do it. Please help!!! On Thursday, 17 October 2013 12:26:11 UTC+5:30, ranjith wrote: Thanks for the information. I hope so now I can proceed with that. Also, is there any callbacks for the table

[web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread Niphlod
use DAL callbacks if you need mass inserts to work in the same way. http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#before-and-after-callbacks On Wednesday, October 16, 2013 8:07:06 PM UTC+2, ranjith wrote: Hi, I want to add a membership to a user when a new

[web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread 黄祥
other way i think you can add auth.add_permission on your script, something like : # add group auth.add_group('Manager', 'Manager') auth.add_group('Admin', 'Admin') # add user db.auth_user.bulk_insert([{'first_name' : 'Manager', 'last_name' : 'Manager', 'email' : 'a...@a.com', 'username' :

Re: [web2py] Re: Calling a function while adding an entry to auth_user table

2013-10-16 Thread ranjith2041
Thanks for the reply. On Thu, Oct 17, 2013 at 5:15 AM, 黄祥 steve.van.chris...@gmail.com wrote: other way i think you can add auth.add_permission on your script, something like : # add group auth.add_group('Manager', 'Manager') auth.add_group('Admin', 'Admin') # add user