Do you mean like:

requires=IS_IN_DB(db,'sometable.id','%(name)s (%(description)s)')

If so, yes I have them there. The purpose is to create the drop down 
menu... unless I'm doing it wrong? Or is there another way about it so that 
the references will appear per the manual?

Thanks Anthony!

On Wednesday, August 1, 2012 11:21:40 PM UTC+8, Anthony wrote:
>
> Have you explicitly set any validators for the field (e.g., IS_IN_DB)? I 
> believe you only get the default represent attribute when you don't 
> explicitly set a validator (perhaps that should be changed).
>
> Anthony
>
> On Wednesday, August 1, 2012 11:17:24 AM UTC-4, lyn2py wrote:
>>
>> I refer to http://web2py.com/books/default/chapter/29/6 under Record 
>> representation
>>
>>> The format attribute will be used for two purposes:
>>>    
>>>    - To represent referenced records in select/option drop-downs.
>>>
>>>
>>>    - To set the db.othertable.person.represent attribute for all fields 
>>>    referencing this table. This means that SQLTABLE will not show 
>>> references 
>>>    by id but will use the format preferred representation instead.
>>>
>>>
>>
>>    1. I have specified the format but it doesn't appear per the format 
>>    (in appadmin, when listing table records). I have restarted the server 
>>    (just in case) but it still references the ID rather than the specified 
>>    format. Any ideas?
>>    2. It also doesn't appear so in the drop down menus (again, all 
>>    appear as IDs). I had to separately specify the format for the drop down 
>>    menus. Is it supposed to work this way? It doesn't seem like it based on 
>>    the above explanation.
>>
>> Please help. Thanks!
>>
>>

-- 



Reply via email to