Re: [web2py] Re: caching questions

2016-04-28 Thread Richard Vézina
On Wed, Apr 27, 2016 at 4:44 PM, Niphlod wrote: > on these "philosophical" notes, boring for someone, exciting for yours > truly, the are a few other pointers (just to point out that the concept of > "caching" isn't really something to discard beforehand)...be aware that on >

[web2py] Re: SQLFORM return javascript on accept

2016-04-28 Thread Mark Billion
Thats brilliant, but when I put it in the script in, it doesnt work: ajax_form = SQLFORM(db[field_array[3]], this_page_ajax, deletable=True) if ajax_form.process().accepted: response.js = 'alert("hi");' The form is being called thru a modal and ajax iframe, but even when

[web2py] Re: SQLFORM return javascript on accept

2016-04-28 Thread Anthony
If the form action itself is loaded in an iframe, then it won't work, as response.js is only executed at the end of Ajax requests. Is there any reason it needs to be loaded in an iframe rather than via a standard Ajax request? It might help if you show more of the relevant code. Anthony On

[web2py] Re: Using python as an user rules engine in a web2py application

2016-04-28 Thread Carlos Kitu
Thank you very much Leonel. This is also a very useful hint. As with the previous recommendation I need a deeper knowledge about the subject to make a decission, and this is a good point to start with. Thank you and best regards. El miércoles, 27 de abril de 2016, 14:48:18 (UTC+2), Leonel

[web2py] routes.py

2016-04-28 Thread 'Annet' via web2py-users
I have a routes.py file in web2py's home directory which contains the follwing code: routes_onerror = [ (r'init/*', r'/error/default/index') ,(r'org/*', r'/error/default/index') ,(r'*/404', r'/error/default/index') ,(r'*/*', r'/error/default/index') ] # specify action in charge of

[web2py] list:reference - Input Data

2016-04-28 Thread leonardoporto
Hello guys, good afternoon! Maybe I'm missing something absurd, I'm not seeing, but this is my first app to study web2py. I have some tables with relationships, but I can not enter data in Table Movies, which has fields related to other tables. Under the codes and the results. Thanks a lot for

[web2py] One form for two tables

2016-04-28 Thread Andrea Marin
Hi all, I'm trying to setup a form to manage two tables: db.define_table('pratiche', Field('nome', requires=IS_NOT_EMPTY()), Field('descrizione', 'text', requires=IS_NOT_EMPTY()), Field('stato_pratica', requires=IS_IN_SET(['aperta', 'attesa',

[web2py] Re: One form for two tables

2016-04-28 Thread Anthony
When using SQLFORM.factory, a dummy DAL object is created and doesn't have any default upload folder, so for any upload fields, you must specify the "uploadfolder" argument. Anthony On Thursday, April 28, 2016 at 6:04:01 PM UTC-4, Andrea Marin wrote: > > Hi all, > > I'm trying to setup a form

Re: [web2py] Re: How can I pre populate a option column of a form?

2016-04-28 Thread Andrea Marin
Thanks for this method Il giorno giovedì 28 aprile 2016 20:10:46 UTC+2, Val K ha scritto: > > 'form.vars.field = any' must be placed before form.process() > So, in your case: > form = SQLFORM(db.pratiche) > form.vars.stato_pratica = 'aperta' > > if form.process().accepted: > >

[web2py] Re: list:reference - Input Data

2016-04-28 Thread 黄祥
please try: db.movies.category.requires = IS_IN_DB(db, 'categories.title', db.categories._format, multiple = True) ref: http://web2py.com/books/default/chapter/29/07/forms-and-validators#Validators best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: One form for two tables

2016-04-28 Thread Anthony
Specifically, before creating the form, something like this should work: db.allegati.doc.uploadfolder = os.path.join(request.folder, 'uploads') Anthony On Thursday, April 28, 2016 at 6:39:02 PM UTC-4, Anthony wrote: > > When using SQLFORM.factory, a dummy DAL object is created and doesn't

[web2py] Re: How to increase the number of open forms that can be submitted (from 10) ?

2016-04-28 Thread Anthony
Are you saying you have multiple forms on the same page? The allowance of multiple formkeys for the same form was not really intended for the case of multiple forms on the same page -- rather, it was intended more for the case where the user might open up the same page in multiple browser tabs

[web2py] Re: How to increase the number of open forms that can be submitted (from 10) ?

2016-04-28 Thread Anthony
On Thursday, April 28, 2016 at 11:44:34 AM UTC-4, Leonel Câmara wrote: > > I would probably change the way the application works. There is absolutely > no need for you to have all the 16 forms in the HTML at the same time and > then try to process each one in the controller to see which was

[web2py] Re: deploy to pythonanywhere broken in >= 2.14.x version

2016-04-28 Thread Leonel Câmara
Seems like a javascript issue as the problem seems to be only in the UI as the deploy button is becoming available sooner than it should. Strange. since everything worked well before and we didn't change anything in that particular code. I'll look into it. -- Resources: - http://web2py.com -

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-28 Thread Ron Chatterjee
Have anyone used yagmail? http://kootenpv.github.io/2016-04-24-yagmail On Friday, April 22, 2016 at 2:34:54 AM UTC-4, Mirek Zvolský wrote: > > Not sure if I properly understand your question. > But.. > > I use this in starting web in such easy way: > - Virtual server Debian, no SMTP/POP3

[web2py] Re: How to increase the number of open forms that can be submitted (from 10) ?

2016-04-28 Thread Leonel Câmara
I would probably change the way the application works. There is absolutely no need for you to have all the 16 forms in the HTML at the same time and then try to process each one in the controller to see which was submitted. Just load the form you need when you need it using ajax. That said

[web2py] Re: deploy to pythonanywhere broken in >= 2.14.x version

2016-04-28 Thread Giles Thomas
OK, thanks for the clarification. *Leonel* -- we're not seeing any errors on our side, and I don't think we've changed anything in the API -- we certainly haven't changed anything deliberately. Can you think of anything that might be causing this? On Friday, April 22, 2016 at 12:45:22 AM

[web2py] Re: I need help with db.executesql()

2016-04-28 Thread Val K
is there "# -*- coding: utf-8 -*-" as first line of your file.py? On Friday, April 22, 2016 at 4:13:54 PM UTC+3, c.lp...@gmail.com wrote: > > hi,All: >when i execute the following code: > >>> from gluon import * > >>> db = >

[web2py] Re: How to keep a Bootstrap Modal open even after a form submission

2016-04-28 Thread Ron Chatterjee
Thank you. Only caveat to this solution is, every time someone access the page, the model will be showing. An alternative solution will be to keep the modal close untill the page is accessed, once the page is accessed invoke the modal "open" by clicking the button. I would imagine the

[web2py] Execution of import statements

2016-04-28 Thread Mark Billion
I understand that the whole default.py file is executed on each request to a function internal to it. But does it import if the statement evaluates to false? For example if default.py has: Function x(): If 1==2: Import a Does a get imported every time function x is called? --

[web2py] update table and calculate FIFO methods

2016-04-28 Thread 黄祥
is there a way to update table and calculate using FIFO (First In First Out) methods? e.g. Unit Trade Unit Remaining Subscription Unit NAV Date 3.000,00 1.000,00 1.000,00 01/03/2016 2.000,00 1.000,00 1.000,00 01/02/2016 1.000,00 1.000,00 1.000,00 01/01/2016 let say i have the data above, when

[web2py] Re: update table and calculate FIFO methods

2016-04-28 Thread Dave S
On Thursday, April 28, 2016 at 4:23:26 PM UTC-7, 黄祥 wrote: > > is there a way to update table and calculate using FIFO (First In First > Out) methods? > e.g. > Unit Trade Unit Remaining Subscription Unit NAV Date > 3.000,00 1.000,00 1.000,00 01/03/2016 > 2.000,00 1.000,00 1.000,00 01/02/2016 >

Re: [web2py] Re: How can I pre populate a option column of a form?

2016-04-28 Thread Val K
'form.vars.field = any' must be placed before form.process() So, in your case: form = SQLFORM(db.pratiche) form.vars.stato_pratica = 'aperta' form.add_button('Back', URL('index')) if form.process().accepted: On Friday, April 22, 2016 at 12:23:59 AM UTC+3, Andrea Marin wrote: > >

[web2py] How to increase the number of open forms that can be submitted (from 10) ?

2016-04-28 Thread Robert Pates
I have inherited a very nice clinical trials randomization module written in web2py (2.9.5) and have been asked to modify it to accommodate a new clinical study. The application features a screen to display all the randomization strata in a list on the screen -- each stratum generates a form

[web2py] Version spanish the book with error

2016-04-28 Thread domezzzz
Access to books in Spanish version, except the prologue, gives the following error Access: http://web2py.com/books/default/chapter/41/01/introduccion Response: " Internal errorTicket issued: books/167.60.25.205.2016-04-28.19-34-49.e80354e6-8fee-47e8-9512-2525744cda96

[web2py] Re: update table and calculate FIFO methods

2016-04-28 Thread 黄祥
pardon, i forgot to include my code i'm done so far with the unexpected result (no error occured) code: def __after_insert_redemption_detail(f, id): query_unit = db.unit.account == f['account'] row_unit = db(query_unit).select(orderby = ~current.db.unit.id).first() db.unit.insert(account =

[web2py] Re: How to integrate SendGrid in Web2py ?

2016-04-28 Thread Michael Beller
I haven't used yagmail, I only looked quickly but I didn't see an advantage of yagmail over the web2py mail functions. The bootply layout below looks great - I don't see any reason that wouldn't work. Do you want to receive email into the app? I didn't see how yagmail supports inboud email,

Re: [web2py] Re: Using python as an user rules engine in a web2py application

2016-04-28 Thread Dave S
On Thursday, April 28, 2016 at 12:01:50 PM UTC-7, Richard wrote: > > Why not just found a way to attach Ipython notebook (which seem to had > been renamed Jupyter) to your app?? > > https://jupyter.org/ > > By providing dataset over which users can interact with... I am not sure > exactly how

Re: [web2py] Re: Using python as an user rules engine in a web2py application

2016-04-28 Thread Richard Vézina
Why not just found a way to attach Ipython notebook (which seem to had been renamed Jupyter) to your app?? https://jupyter.org/ By providing dataset over which users can interact with... I am not sure exactly how to do that, but one idea could be to db select data that user can play with inside

Re: [web2py] Serialize object having js-function()

2016-04-28 Thread Manuele Pesenti
Il 28/04/16 00:26, Val K ha scritto: > Hi! > I made mini but useful and universal class to hold json-serializable > objects. > Main goal - serialize objects having items-function() as js-objects > It looks very interesting to me :) Thank you for sharing! I'll notice here if I use it for a little

Re: [web2py] Re: Using python as an user rules engine in a web2py application

2016-04-28 Thread Richard Vézina
Good points... I forgot about the aspect of changing site way to make calculation... At the same time, I understand the need as more specific for some user the rest of the crowd stock with the basic calculation if they don't know how to hack their own calculation function... In this context