Hello there,

I'm using a list:reference type field (f_keypersons in the code below). 
Having two issues here:
1. When adding/editing a record the dropdown appears on the corresponding 
field with correct options, but NO "+/-" sign as usual list fields. 
2. After select one option value and submit the field is still blank when 
listing this record again. Checking the record in appadmin, the value under 
this field is [2L] while it is supposed to be [2] which is the id in the 
referenced table. Trying to manually assign a value to this field but can' 
change it.
Any help is appreciated.

<https://lh6.googleusercontent.com/-2xTeiWv_i7k/UWFbepS2nOI/AAAAAAAABug/KkIlCjMV5ts/s1600/1.png>

Related code:
db.define_table('t_prospects',
    Field('f_account', db.t_accounts, required=True, 
          label=T('Account')),
    Field('f_project', db.t_projects, required=True,
          label=T('Project')),
    Field('f_keypersons', type='list:reference t_contacts', requires=
IS_IN_DB(db, 't_contacts.id', '%(f_name)s'),
          label=T('Key Person')),
    auth.signature,
    format='%(f_account)s',
    migrate=settings.migrate)
db.t_prospects.f_account.requries = [IS_NOT_EMPTY(), IS_IN_DB(db, 
't_accounts.id', '%(f_name)s')]
db.t_prospects.f_project.requries = [IS_NOT_EMPTY(), IS_IN_DB(db, 
't_projects.id', '%(f_project)s')]

db.define_table('t_contacts',
    Field('f_name', type='string', required=True,
          label=T('Name')),
    Field('f_tel1', type='string',
          label=T('Telephone 1')),
    Field('f_tel2', type='string',
          label=T('Telephone 2')),    
    Field('f_fax', type='string',
          label=T('Fax')),
    Field('f_mobile', type='string',
          label=T('Mobile')),
    Field('f_email1', type='string',
          label=T('Email 1')),
    Field('f_email2', type='string',
          label=T('Email 2')),
    Field('f_remarks', type='list:string',
          label=T('Remarks')),
    auth.signature,
    format='%(f_name)s',
    migrate=settings.migrate)
db.t_contacts.f_name.requires=IS_NOT_EMPTY()


-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to