On Sat, Aug 8, 2009 at 11:29 AM, suiato <homm...@gmail.com> wrote: > > Yet another auth-related posting... > > I was a bit surprised, when trying to customize the auth_user table, > that the fields 'first_name' and 'last_name' were mandatory. Because > they are used in other places in gluon/tools.py: table_membership, > table_event, get_or_create_user0 and description for a register form. > > I followed the instruction on Customizing auth_user > (web2py_manual_678.pdf), added a field 'username' with the NOT_IN_DB > validator, and changed menu.py to display username instead of first > name in the Authentication box. All worked fine :-) > > As a minimal auth_user, I was thinking of using username and password > only, but, deleting the fields 'first_name' and 'last_name' broke the > code because they were used in other places as mentioned above. Is > the 'email' field mandatory as well? Probably, but haven't checked it > yet. I haven't figured out what registration_key is and does...
Registration key is what is emailed to user upon registratoin; when they correctly follow the return link (or enter the matching registration_key) then they are seen to be registered with the correct email address, and the key is cleared, and they are allowed to login. As long as the key has not been matched, and is still in the database, the registration is treated as unconfirmed / invalid, and login is not allowed. > > > There is another problem regarding the notion of first_name and > last_name when I try to use them in Japanese. Because in Japanese the > order is family_name and then given_name, i.e., last_name and then > first_name. Chinese has the order, too, I think. How about middle > name? I know Brazilian has longer names... As such, for l10n, > customizing the name part is necessary, but it requires changing gluon/ > tools.py in the current setting. You can change this yourself (see below). > > Talking about l10n, I'm not sure yet how to translate the error > messages in Auth... They need to be translated because they may be > exposed to users when a form is not filled, for example. All the auth messages can be customized e.g. you can reassign them in your application, auth.messages.label_first_name = T('Given name') you would think by default they should be translated strings, e.g. T(somestring) - but the issue I think is that they are in gluon, and thus run at server start - that is, they would not adjust to individual user's locale. If you want, you can reassign these in your application (look for self.messages in gluon/tools.py). I wonder if some sort of lazy message assignment/translation would be reasonable / possible.. > > Perhaps, these issues are already addressed, or solved or being solved > by Massimo and developers. I will appreciate any advice or pointers. > > -- > Teru > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---