Doesn't look like the grid will let you do it (we should probably update 
the code to make this more flexible). I think your alternative would be to 
suppress the display of the file field and add your own additional column 
via the "links" argument.

Anthony

On Tuesday, November 19, 2013 11:47:02 PM UTC-5, Sarbjit wrote:
>
> Its not so clear from Niphold answer's on how this can be achieved.
>
> On Tuesday, November 19, 2013 9:52:56 PM UTC+5:30, Richard wrote:
>>
>> See Niphold answer here : 
>> https://groups.google.com/d/msg/web2py/-ErAU2GkTUQ/ddAV4WEYNyQJ
>>
>>
>> On Tue, Nov 19, 2013 at 5:50 AM, Sarbjit <[email protected]> wrote:
>>
>>> 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.
>>>
>>
>>

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