On Tuesday, June 19, 2018 at 3:00:03 PM UTC-4, Andrea Fae' wrote:
>
> Thank you Leonel, but when I try to insert to db for example this name
> "Donà" in the username field (table auth_user) the system tells me that is
> not possible...So, what to do? Convert "Donà" in "Dona" without accent?
> Which characters can I use in the username field? In the book there is only
> db_codec=latin...where can I find documentation about encoding ....in
> python documentation? thank you
>
The default validators for the username field are:
[IS_MATCH('[\w\.\-]+', strict=True,
error_message=self.messages.invalid_username),
IS_NOT_IN_DB(db, '%s.username' % settings.table_user_name,
error_message=self.messages.username_taken)]
You could replace the IS_MATCH with a custom validator that accepts unicode
characters, or just remove IS_MATCH altogether.
Anthony
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.