With the below models and controllers, In the view corresponding to 
Mytable2, I am getting the uploaded file name as "file". How can I show the 
actual file name that was being uploaded instead of "file"

*Model:*

db.define_table('Mytable1', Field('Mytable1_field1'),
                                Field('Mytable1_field2','text')
                                )
                                
db.define_table('Mytable2', Field('Mytable2_files', 'upload'),
                                     Field('Mytable2_ref' , 'reference 
Mytable1'))

db.Mytable2.Mytable2_ref.requires = IS_IN_DB(db, db.Mytable1.id, 
'%(Mytable1_field1)s')


*Controller:*

def viewdata():
    grid = 
SQLFORM.smartgrid(db.Mytable1,csv=False,linked_tables=['Mytable2'],)
    return dict(grid=grid) 

-- 
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