Re: [web2py] Changing the default PDF dowload filename (fpdf)

2017-02-12 Thread José Luis Redrejo
HI, this is how I do it: response.headers['Content-Disposition'] = 'attachment; filename=as_you_wish.pdf' regards José L. 2017-02-13 1:04 GMT+01:00 Paul Ellis : > When want to save a PDF made with FPDF and web2py. The filename is always > the controller function name

[web2py] Re: Calling controller from javascript

2017-02-12 Thread T.R.Rajkumar
You can call a controller function from view by using ajax. The form is generated in controller as below. TD(INPUT(_id='txt'+str(i+1)+'2',_name='txt'+str(i+1)+'2',value=row.lp_mcod,_style='width:100px;',_onblur='getDescr(this)')) In the onblur event you call the javascript funciton defined below

[web2py] Re: info: interesting hack, sort in IS_IN_DB lists with regard to current locale

2017-02-12 Thread Niphlod
BTW: setlocale is not threadsafe. -- 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

[web2py] Re: how to load modules permanently

2017-02-12 Thread 黄祥
i think you can define import your_custom_modules in models/db.py it will affect on every controllers best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] dynamic view update

2017-02-12 Thread shamimur . rahman
Hi All, I am new to web2py. I am using paramiko with web2py to execute some commands on a remote server(linux) and display it on the web page. So i have a controller which has form with fields hostname, username, password for the server to be connected. If the form is accepted it is

[web2py] db.table vs reference table

2017-02-12 Thread Charles
Hi, Maybe a trivial question but if db.table could lead to used variable before declaration errors, why allow this form at all ? Or are there some cases where it is of better use ? Thanks -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] how to load modules permanently

2017-02-12 Thread Khalil Khamlichi
Hi, How can I import modules permanently inside web2py so that I do not have to import them again and again inside every function in controller ? thanks in advance. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: plugins

2017-02-12 Thread Andrew Andreyev
When I click on this link I get: Internal errorTicket issued: unrecoverable On Saturday, March 12, 2011 at 1:18:26 AM UTC+10:30, Massimo Di Pierro wrote: > > I did a very poor job at keeping track of community created plugins. >

[web2py] BOOTSTRAP DATEPICKER AUTOCLOSE

2017-02-12 Thread Áureo Dias Neto
Hello, i'm using the bootstrap datepicker module created by Leonel Camara.. my question is, how to autoclose this after date selection? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Changing the default PDF dowload filename (fpdf)

2017-02-12 Thread Paul Ellis
When want to save a PDF made with FPDF and web2py. The filename is always the controller function name (pdf_view) in this case. I would like to make the filename take a value from the database. Customer name or Business name for example. I have tried adding a name in the output() but it

[web2py] Re: Python Social Auth - example site working with downlevel version of PSA

2017-02-12 Thread Joe Barnhart
Thanks Donald! So the repo contains an application and the plugin, already "installed." So to add this to my own application, I separate out the "plugin" pieces and incorporate them into my app, right? That means I copy out any directory with the plugin name as well as any *.py files

[web2py] Re: Calling controller from javascript

2017-02-12 Thread Gael Princivalle
Hello. You can do it with ajax: $.ajax({ type: "POST", url: "{{=URL('f_ajax','get_user_events')}}", data:{east, west, south, north, user_period, userId}, success: function( returnedData ) { $(

[web2py] Re: compile error : Exception: name 'session' is not defined in views

2017-02-12 Thread Anthony
Note, in that case, the compiled view will include the included view, and it will simply be conditionally rendered at run time (which is fine). Antony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Calling controller from javascript

2017-02-12 Thread Andrea Fae'
Ho to call a controller function from: - javascript (inside a view) - from html view ({{put controller function here?}} Can I have the exact syntax on both cases? Thank you -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Newbie questions about Apache & Web2PY

2017-02-12 Thread Scott ODonnell
All , I've only used the native web2py webserver in the past. I've recently had to move to Apache as a requirement for the environment the apps need to live in. I was able to get things up and running but ran into a problem where the default system python is 2.7.6 and I need a minimum of 2.7.9

[web2py] Re: compile error : Exception: name 'session' is not defined in views

2017-02-12 Thread 黄祥
thanks anthony, i've modified my code it can be compiled right now and the code works like before *e.g.views/test/test. load* {{if session.test:}} {{include 'templates/test.html'}} {{pass}} thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] compile error : Exception: name 'session' is not defined in views

2017-02-12 Thread Anthony
Any Python code in the template directives (i.e., "include", "exclude", "block") is evaluated at compile time, as the directives are needed to create the compiled views. However, in this case you include an object that is only available at run time ("session"), which is not allowed. Antony --

[web2py] Fullcalendar scheduler - creating, changing and saving data to database

2017-02-12 Thread Andrea Fae'
Hello guys, I'm trying to use Fullcalendar scheduler for my application Now I can retrieve resources and event from database. Next step I have to: - create new events simply clicking and dragging to the scheduler fullcalendar and saving event to the database - when moving or resizing events,