Oh good. Thanks for the response. I added the format and it worked.

But, here I have one problem. In the table(subject_class) I am only having 
a combination of two foreign keys and no other columns. So, adding the 
format to any/both of those values will only show an integer in the 
dropdown which will be meaningless.
db.define_table('subject_class',
    Field('class_id', 'reference class_tbl'),
    Field('subject_id', 'reference subject_bs')
    )
So, for the format in the table subject_class alone, is there a way to show 
the columns in (class_tbl/subject_bs) table which contains meaningful 
string columns. If done, in the dropdowns, it will be easier to select the 
entries which provide the meaningful information instead a number.

On Wednesday, 23 October 2013 18:49:31 UTC+5:30, Massimo Di Pierro wrote:
>
> Because the referenced tables do not have a format = '%(....)s' 
> representation.
>
> On Wednesday, 23 October 2013 02:45:15 UTC-5, ranjith wrote:
>>
>> Hi,
>>
>> I have defined some tables as below,
>> db.define_table('subject_class',
>>     Field('class_id', 'reference class_tbl'),
>>     Field('subject_id', 'reference subject_bs')
>>     )
>> db.define_table('subjectgroup_tbl',
>>     Field('class_id', 'reference class_tbl'),
>>     Field('subgroup_name', 'string')
>>     )
>> db.define_table('subjectgroup_subject_tbl',
>>     Field('subject_id', 'reference subject_class'),
>>     Field('subgroup_id', 'reference subjectgroup_tbl')
>>     )
>>
>> In this, while inserting in the tables(subject_class, subjectgroup_tbl) 
>> via appadmin, their foreign keys are shown in the dropdowns. 
>>
>> But while trying to insert in the table "subjectgroup_subject_tbl", *the 
>> referencing values are shown as the input test box and not as dropdowns. 
>> *If i enter some random inputs and so a submit, an exception occurs 
>> saying foreign key contraint fails which is an expected result.
>>
>> But why those values are not shown as dropdowns. Is there any bug in 
>> web2py?? 
>>
>

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

Reply via email to