Hello,

I am running into a representation issue whenever I try to put a validator 
on a reference field. For example, I have the following table:
db.define_table('t_port_to_jack',
    Field('switch', db.switches),
    Field('switch_port_string', type='integer', notnull=True,required= 
True,label=T('The port of the switch the jack connects to')),
    
Field('jack_id_string',db.jack_listings,requires=IS_NOT_IN_DB(db,'t_port_to_jack.jack_id_string')))

So the problem I am having is with jack_id_string, I need it to be unique 
in this table but the issue is that as soon as I add this 'requires' 
statement at the end, in all of the CRUD table views, it no longer shows 
the field represented string and instead shows the id #. After I remove the 
requires statement it reverts to the desired behavior where users see the 
db.jack_listings format string instead of the id#.

My question is, how can I keep this requires functionality but still have 
the field display as the correct representation in tables?

Thanks for your help in advance!
Mike

Reply via email to