I think Bruno meant that he includes that code inside his def user(): function in controllers/default.py
On Thursday, August 30, 2012 3:47:19 AM UTC+1, Alec Taylor wrote: > > Thanks Niphlod also > > On Thursday, August 30, 2012 4:50:55 AM UTC+10, rochacbruno wrote: >> >> >> I generally do this on user function: >> >> profile_fields = ['first_name', 'last_name', 'email', 'description', >> 'picture'] >> >> if 'profile' in request.args: >> for field in db.auth_user.fields: >> if field not in profile_fields: >> db.auth_user[field].readable = db.auth_user[field].writable = >> False >> > > You mention you do this on the user function, can you be more specific? > > >> On Wed, Aug 29, 2012 at 3:24 PM, Alec Taylor <[email protected]> wrote: >> >>> I have been extending my auth_user table with a bunch of new options. >>> >>> When there's a 1:1 relation with the user, I'll store it in their >>> profile. >>> >>> On 1:n, I'll keep them in separate tables. >>> >>> Now I am realising the problems with doing it this way. To make my >>> register form "nice" I have set almost all fields with readable=Falseand >>> writable=False. >>> >>> This means that I can no longer use the crud.create or crud.update form >>> creator helpers on those subset of a users' profile I want the form to >>> change for them. >>> >>> But it also has its advantage: no extra queries are required to grab all >>> the 1:1 fields of a users' profile after login. >>> >>> Is this enough of an advantage? >>> >>> Thanks for all suggestions, >>> >>> Alec Taylor >>> >> --

