On Sunday, October 23, 2011 9:33:34 AM UTC-4, lucas wrote:
>
> hello one and all, 
>
> playing with auth_user.  trying to follow the manual with a bit of 
> modification, thinking: 
>
> auth = Auth(db)                                # authentication/ 
> authorization 
> auth.settings.extra_fields['auth_user'] = [ 
>     Field('prefix_title', length=12, comment='Enter your Name 
> Prefix'), 
>     Field('professional_title', length=12, comment='if you have one, 
> Enter your Professinal Title'), 
>     Field('mailing_address', length=1024, comment='Full Mailing 
> Address including Street, City, State, Zip/Postal, and Country'), 
>     Field('Telephone', length=32, comment='include Area Code or 
> Country Code if outside the USA')] 
> db.auth_user.prefix_title.requires = 
> IS_IN_SET(('Mr.','Ms.','Mrs.','Dr.','Rev.','Hon.')) 
> db.auth_user.professional_title.requires = 
> IS_IN_SET(('','Ph.D.','M.D.','Ed.D.','M.B.A.','C.P.A.','P.A.','M.S.','M.A.')) 
>
> auth.define_tables() 
>
> but the bottom two requires to fill the lists are bugging out. 
> suggestions on this modify?


The auth_user table doesn't exist until you call auth.define_tables(), so 
either move the 'requires' into the Field() definitions, or move those lines 
after auth.define_tables():

Field('prefix_title', ..., requires=IS_IN_SET(...))

also, i would like to change to field order.  how can i do that also? 
>

I don't think you can do that (easily) without defining the whole table from 
scratch. If you just want to control the display of the registration/profile 
forms, you can create custom forms and specify the order of the fields 
however you want.

Anthony

Reply via email to