Hi Richard, Thank you for responding.
I'm basically letting a user create their own view for SQLFORM.grid, by choosing which fields to use by selecting them. db.unique_view_peruser is my table which allows each user to go and check the boxes of the fields they want to view. It's just booleans that are set to On or Off. Whatever they choose I want to select the fields in another table (which mirror the unique_view_peruser). The problem is each time I access SQLFORM(db.unique_view_peruser) it simply inserts the record instead of retrieves the previous selection. I know this is something which has to reference the db.auth_user.id, but it doesn't seem to be working the way I had imagined. On Friday, March 27, 2015 at 10:00:49 AM UTC-4, Richard wrote: > > If you only want the user to see the data but not edit : readonly=True... > > Richard > > On Fri, Mar 27, 2015 at 9:59 AM, Richard Vézina <ml.richa...@gmail.com > <javascript:>> wrote: > >> You mean a profile page with user only allow to update their profile ?? >> >> SQLFORM(db.auth_user, record=*auth.user_id*) >> >> It is not clear to understand your goal... >> >> Richard >> >> On Fri, Mar 27, 2015 at 9:32 AM, LoveWeb2py <atayl...@gmail.com >> <javascript:>> wrote: >> >>> Hello, >>> >>> I have a database with a few hundred users. How could I allow them to >>> each have their own SQLFORM without modifying auth.user >>> >>> here is what I have so far: >>> >>> >>> #model >>> db.define_table('unique_view_peruser',' >>> Field('auth_user_id',' db.auth_user, default=auth.user_id, >>> writable=False), >>> Field('field1','boolean'), >>> Field('field2','boolean'), >>> migrate=False) >>> >>> #controller >>> def unique_view(): >>> grid = SQLFORM(db.unique_view_peruser) >>> return dict(grid=grid) >>> >>> when I click on the boolean buttons they're not being updated or insert >>> into the database. I'm using MYSQL and each field is specified as a boolean. >>> >>> How could I allow each user to come to the view, click on the different >>> fields they'd like and have it insert the database. Will it automatically >>> create the record for them if they don't have a record associated with >>> their id? >>> >>> Thanks! >>> >>> >>> -- >>> Resources: >>> - http://web2py.com >>> - http://web2py.com/book (Documentation) >>> - http://github.com/web2py/web2py (Source code) >>> - https://code.google.com/p/web2py/issues/list (Report Issues) >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "web2py-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to web2py+un...@googlegroups.com <javascript:>. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.