On Mon, Jul 2, 2012 at 8:13 PM, Alexei Vinidiktov <
[email protected]> wrote:

> Hello,
>
>
> [...]
>
>
> The problem is with the native language select box. When the user goes to
> his profile page nothing is selected in it. The user has to choose his
> native language again if he wants to submit changes to his profile
> information.
>
>
> The list box with the languages he is learning is displayed fine - it has
> all the user's languages selected.
>
>
> Here's how I add the extra fields in my db.py:
>
>
> db.define_table('native_language',Field('name'),format='%(name)s')
>
> db.define_table('learn_language',Field('name'),format='%(name)s')
>
>
> auth.settings.extra_fields['auth_user']= [
>
> Field('native_language','list:reference native_language', requires =
> IS_IN_DB(db,'native_language.id
> ',db.native_language._format,multiple=False)),
>
> Field('learn_language','list:reference learn_language', requires =
> IS_IN_DB(db,'learn_language.id',db.learn_language._format,multiple=True))
>
> ]
>
>
>
>
Nevermind. I've found my mistake.

The correct field definition for native_language should be:

Field('native_language', db.native_language, requires = IS_IN_DB(db,'
native_language.id',db.native_language._format,multiple=False)),


-- 
Alexei Vinidiktov

Reply via email to