csv=False should disable exports alltogether: how can you reach that url ?

On Monday, March 2, 2015 at 7:21:12 PM UTC+1, Dmitry Ermolaev wrote:
>
> make table view:
>     t = t and SQLFORM.smartgrid(db[t],
>           maxtextlengths = { 'fonds.name': 60, 'fonds.info': 200 },
>           upload=URL('download'),
>           links_in_grid=False,
>           csv=False,
>           )
>
> open url:
>
> members/memb_goods.memb_id/5?keywords=1&order=memb_goods.amo&_export_type=tsv
>
> error
> web2py™Version 2.9.12-stable+timestamp.2015.01.17.06.11.03PythonPython 
> 2.7.6: C:\Python27\python.exe (prefix: C:\Python27)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
>
> Traceback (most recent call last):
>   File "C:\web2py-m\gluon\restricted.py", line 224, in restricted
>     exec ccode in environment
>   File "C:/web2py-m/applications/polza/controllers/transs.py" 
> <http://127.0.0.1:8000/admin/edit/polza/controllers/transs.py>, line 135, in 
> <module>
>   File "C:\web2py-m\gluon\globals.py", line 393, in <lambda>
>     self._caller = lambda f: f()
>   File "C:\web2py-m\gluon\cache.py", line 576, in wrapped_f
>     rtn = cache_model(cache_key, lambda : func(), time_expire=time_expire)
>   File "C:\web2py-m\gluon\cache.py", line 223, in __call__
>     value = f()
>   File "C:\web2py-m\gluon\cache.py", line 576, in <lambda>
>     rtn = cache_model(cache_key, lambda : func(), time_expire=time_expire)
>   File "C:/web2py-m/applications/polza/controllers/transs.py" 
> <http://127.0.0.1:8000/admin/edit/polza/controllers/transs.py>, line 24, in 
> index
>     csv=False,
>   File "C:\web2py-m\gluon\sqlhtml.py", line 2964, in smartgrid
>     user_signature=user_signature, **kwargs)
>   File "C:\web2py-m\gluon\sqlhtml.py", line 2353, in grid
>     rows.colnames = expcolumns
> AttributeError: 'list' object has no attribute 'colnames'
>
> Error snapshot [image: help] 
> <http://127.0.0.1:8000/admin/default/ticket/polza/127.0.0.1.2015-03-02.21-17-11.163149cf-6dcf-43df-89c8-ed4b935d1e2a#>
>
> <type 'exceptions.AttributeError'>('list' object has no attribute 
> 'colnames')
>
> inspect attributes
> Frames
>    
>    - 
>    
>    *File C:\web2py-m\gluon\restricted.py in restricted at line 224* код 
>    аргументы переменные
>    - 
>    
>    *File C:\web2py-m\applications\polza\controllers\transs.py in <module> 
>    at line 135* код аргументы переменные
>    - 
>    
>    *File C:\web2py-m\gluon\globals.py in <lambda> at line 393* код 
>    аргументы переменные
>    - 
>    
>    *File C:\web2py-m\gluon\cache.py in wrapped_f at line 576* код 
>    аргументы переменные
>    - 
>    
>    *File C:\web2py-m\gluon\cache.py in __call__ at line 223* код аргументы
>     переменные
>    - 
>    
>    *File C:\web2py-m\gluon\cache.py in <lambda> at line 576* код аргументы
>     переменные
>    - 
>    
>    *File C:\web2py-m\applications\polza\controllers\transs.py in index at 
>    line 24* код аргументы переменные
>    - 
>    
>    *File C:\web2py-m\gluon\sqlhtml.py in smartgrid at line 2964* код 
>    аргументы переменные
>    - 
>    
>    *File C:\web2py-m\gluon\sqlhtml.py in grid at line 2353* код аргументы 
>    переменные
>    Function argument list
>    
>    (query=<Query (memb_goods.memb_id = 5)>, 
>    fields=[<gluon.dal.objects.Field object>, <gluon.dal.objects.Field 
> object>, 
>    <gluon.dal.objects.Field object>, <gluon.dal.objects.Field object>, 
>    <gluon.dal.objects.Field object>, <gluon.dal.objects.Field object>, 
>    <gluon.dal.objects.Field object>, <gluon.dal.objects.Field object>, 
>    <gluon.dal.objects.Field object>], field_id=<gluon.dal.objects.Field 
>    object>, left=None, headers={}, orderby=<gluon.dal.objects.Field object>, 
>    groupby=None, searchable=True, sortable=True, paginate=20, deletable=None, 
>    editable=None, details=True, selectable=None, create=None, csv=False, 
>    links=[], links_in_grid=False, upload='/polza/transs/download', 
>    args=['members', 'memb_goods.memb_id', '5'], user_signature=True, 
>    maxtextlengths={'fonds.info': 200, 'fonds.name': 60}, 
>    maxtextlength=20, onvalidation=None, onfailure=None, oncreate=None, 
>    onupdate=None, ondelete=None, sorter_icons=(<gluon.html.XML object>, 
>    <gluon.html.XML object>), ui={'button': 'button btn btn-default', 
>    'buttonadd': 'icon plus icon-plus glyphicon glyphicon-plus', 'buttonback': 
>    'icon leftarrow icon-arrow-left glyphicon glyphicon-arrow-left', 
>    'buttondelete': 'icon trash icon-trash glyphicon glyphicon-trash', 
>    'buttonedit': 'icon pen icon-pencil glyphicon glyphicon-pencil', 
>    'buttonexport': 'icon downarrow icon-download glyphicon 
>    glyphicon-download', 'buttontable': 'icon rightarrow icon-arrow-right 
>    glyphicon glyphicon-arrow-right', 'buttontext': 'buttontext button', 
>    'buttonview': 'icon magnifier icon-zoom-in glyphicon glyphicon-zoom-in', 
>    'content': '', ...}, showbuttontext=True, _class='web2py_grid', 
>    formname='web2py_grid', search_widget='default', advanced_search=True, 
>    ignore_rw=False, formstyle='table3cols', exportclasses=None, formargs={}, 
>    createargs={}, editargs={}, viewargs={}, 
> selectable_submit_button='Submit', 
>    buttons_placement='right', links_placement='right', noconfirm=False, 
>    cache_count=None, client_side_delete=False, ignore_common_filters=None)
>    Code listing
>    
>    2348.
>    2349.
>    2350.
>    2351.
>    2352.
>    2353.
>    
>    2354.
>    2355.
>    2356.
>    2357.
>    
>                                            cacheable=True, 
> *selectable_columns)
>    
>                    value = exportManager[export_type]
>                    clazz = value[0] if hasattr(value, '__getitem__') else 
> value
>                    # expcolumns is all cols to be exported including virtual 
> fields
>                    rows.colnames = expcolumns
>    
>                    oExp = clazz(rows)
>                    export_filename = \
>                        request.vars.get('_export_filename') or 'rows'
>                    filename = '.'.join((export_filename, oExp.file_ext))
>    
>    Variablesrows.colnamesundefined
>    
>

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