Hi All,

       I've some virtual fields defined in a table. These are displayed on 
grid using viewargs.

I've provided Export to CSV But it fails because of virtual fields.

It shows errors as '*Row'* *Object has no attribute 'virtual_field_name' *


app settings as below:

*controllers/default.py*


def person_info():

     viewargs =  viewargs = {'fields': [f for f in db.person.__dict__
                           if isinstance(db.company[f],
                                         (Field, Field.Virtual))]}
     export_csv = True
     export_classes = dict(xml=False, html=False, json=False, tsv=False,
                              tsv_with_hidden_cols=False,
                              csv_with_hidden_cols=False)  
    grid = SQLFORM.grid(query, create=False, deletable=False,
                        editable=allow_edit, maxtextlengths=maxtextlengths,
                        showbuttontext=False, csv=export_csv,
                        exportclasses=export_classes, viewargs=viewargs)    

    return dict(grid=grid)


Is it web2py bug? or 
Am I missing anything?

-- 
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/d/optout.

Reply via email to