[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Peter
Hi Niphlod, (& Paolo read this!) halt. downloading is something the browser can decide. opening the saved > file is something your operating system does. > The browser can only send the response which gives the user a choice > between saving and opening directly the file. > If the user

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Alex Glaros
perfect! thanks Niphlod for f in db.Address.fields: if ((specificAddress[f] is None) | (specificAddress[f] == '')): db.Address[f].readable = False -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Niphlod
halt. downloading is something the browser can decide. opening the saved file is something your operating system does. The browser can only send the response which gives the user a choice between saving and opening directly the file. If the user chooses "open" instead of "save" ... nothing can

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Alex Glaros
I left this part out. Should only be one record. specificAddressID = db(db.Address.super_object_fk == specificSuperObjectID).select(db.Address.id,limitby = (0,1)).first().id -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Niphlod
so record = thesingle_record_from_the_table for f in db.table.fields: if record[f] is None: db.table[f].readable = False On Monday, October 17, 2016 at 9:18:49 PM UTC+2, Alex Glaros wrote: > > I left this part out. Should only be one record. > > specificAddressID =

[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Peter
Many thanks for response Paolo! I have tried your suggestion... # pdf.output(rcpt_filepath,dest='S') # response.headers['Content-Type'] = 'application/pdf' # return response.stream(rcpt_filepath, chunk_size=4096, request=request, attachment=True, filename=rcpt_filename) s_io =

[web2py] Re: it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Niphlod
readable is on the Field (i.e. column) so what happens if row 1 has column a,b,c == None and row 2 has a,c,d == None ? On Monday, October 17, 2016 at 9:11:24 PM UTC+2, Alex Glaros wrote: > > Would like to loop through columns in a set object and set readable = > False if the field has no

[web2py] Re: problem with start_time of the scheduler

2016-10-17 Thread Niphlod
BTW: please start adapting your code to use mysched.queue_task() instead of db.scheduler_task.insert(...) . Next releases could change the format of the scheduler_task table and only the queue_task method is the supported one (i.e. will handle eventual corner-cases that won't be possible

[web2py] it it possible to loop through field names and set "readable = False" conditional if field is empty?

2016-10-17 Thread Alex Glaros
Would like to loop through columns in a set object and set readable = False if the field has no data in it something like: [setattr(f, 'readable', False) for f in db.Address if specificAddress.f.name == None] (the set above is created with this line: specificAddress =

[web2py] Re: problem with start_time of the scheduler

2016-10-17 Thread Niphlod
the bug has already been fixed in trunk. You can copy/paste the scheduler.py file from master if you want it solved, or either pass next_run_time equal to start_time to make things work the way they were. On Sunday, October 16, 2016 at 8:30:23 AM UTC+2, mweissen wrote: > > Thank you, but

[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Paolo Valleri
With this: ... s_io = pdf.output(dest='S') response.headers['Content-Type']='application/pdf' response.headers['Content-Disposition'] = 'attachment; filename="%s"' % file_name raise HTTP(200, s_io, **response.headers) You get the same you have now with response.stream but it's cleaner.

[web2py] Re: Force include langauge in URL path

2016-10-17 Thread Marlysson Silva
You could use the T.force([languages]) in your models.py or then at begin file put {{T.force(language)}} Em domingo, 16 de outubro de 2016 14:26:09 UTC-2, Najtsirk escreveu: > > Hi, > > ia have in routes.py: > > > routers = dict( > > # base router > BASE=dict( >