Oh yeah, changes to modules are not updated by default. Add this line to your models/db.py file:
from gluon.custom_import import track_changes; track_changes(True) For more information on using modules with web2py, check out: http://web2py.com/books/default/chapter/29/04/the-core#Sharing-the-global-scope-with-modules-using-the-current-object On Mon, Jul 18, 2016 at 7:05 PM, Sneka R <[email protected]> wrote: > Followed your instructions, but I am getting this Traceback > Traceback > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > > Traceback (most recent call last): > File "/Users/sraveend/Documents/web2py/gluon/restricted.py", line 227, in > restricted > exec ccode in environment > File > "/Users/sraveend/Documents/web2py/applications/ncmi/controllers/project_proposal.py" > > <http://127.0.0.1:8000/admin/default/edit/ncmi/controllers/project_proposal.py>, > line 1, in <module> > from custom_exporter import ExporterCSVlabel > ImportError: cannot import name ExporterCSVlabel > > > On Friday, July 15, 2016 at 10:45:01 PM UTC-5, Jordan Myers wrote: > >> Hey everyone, >> >> so the default csv exporters for sqlform.grid will use the headers as the >> 'database' names, but I would rather it use the field.label instead. For >> example, take this table: >> >> db.define_table('my_table', Field('ugly_name', label='Pretty Name')) >> >> A sqlform.grid on my_table will display the column with the header Pretty >> Name, but when exporting to csv, the header becomes my_table.ugly_name. Is >> there an easy way to export to csv with the columns "as seen" i.e. with the >> labeled names? I tried writing my own exporter, but it does not preserve >> the searching/sorting order. I suppose I could try to implement that >> myself, but that is a last resort. >> >> Thanks >> > -- > 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 a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/MR_8JzzP9o4/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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.

