I am not sure I fully understand but the problem is that

    Field('training_id',
          label=T('Training Status'),
          requires=IS_IN_DB(db,db.training.id,'%(type)s')),

is meant to be a reference but it is not defined as such, replace it with

    Field('training_id','reference training',
          label=T('Training Status')),

On Thursday, 12 December 2013 05:49:51 UTC-6, Warrick wrote:
>
> Hi Guys,
>
> I am trying to build a form. I have the drop down list working in the 
> form, but when I display the record, it displays the id instead of the 
> selected field.
>
> db.define_table('training',
>     Field('type', type='string',
>           label=T('Training Held')),
>     auth.signature,
>     format='%(type)s')
>
> db.define_table('training_archive',db.training,Field('current_record','reference
>  
> training',readable=True,writable=True))
>
> ########################################
> db.define_table('battle_log',
>     Field('battle_date', type='date',
>           label=T('Battles Date')),
>     Field('battles', type='integer',
>           label=T('Battles'),
>           requires=IS_IN_SET(['0', '1', '2', '3', '4', '5', '6', '7', '8', 
> '9', '10'])),
>     Field('reserved', type='integer',
>           label=T('Reserved'),
>           requires=IS_IN_SET(['0', '1', '2', '3', '4', '5', '6', '7', '8', 
> '9', '10'])),
>     Field('training_id',
>           label=T('Training Status'),
>           requires=IS_IN_DB(db,db.training.id,'%(type)s')),
>     Field('comment', type='string',
>           label=T('Comment')),
>     auth.signature,
>     format='%(battles)s')
>
> db.define_table('battle_log_archive',db.battle_log,Field('current_record','reference
>  
> battle_log',readable=True,writable=True))
>
> In another search, I found an easier way to do this, as below:
>
> db.define_table('clan',
>     Field('name', requires=IS_NOT_EMPTY()),
>     format='%(name)s')
>
> auth.settings.extra_fields['auth_user'] = [Field('clan', db.clan)]
>
> The second method was by far easier, how could I implement this in the 
> first example?
>
> Thanks
> Warrick
>

-- 
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/groups/opt_out.

Reply via email to