[web2py] Implementing A Large Scale Engineering Equations Calculator in web2py

2014-08-13 Thread Richard
Nice idea :). I would create a database with the equations including metadata and create froms dynamically like sqlform. A table would have all the equations referring to an other tabel having the equation components als calulated fields. Think from a database driven design rather than a view ba

[web2py] Re: Strange ajax problem

2014-08-13 Thread Cliff Kachinske
Here's how I do it and I assume Web2py does something similar when it, for example, resets the "Working" caption on buttons. The Javascript/Jquery whatever in the client changes the state of the button. I do it before sending the ajax post. I don't know how Web2py does it. It doesn't matter wh

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
Thanks ... Niphlod - I'll try to create a minimal app to reproduce. Cliff - are you suggesting to use the web2py ajax function rather the jQuery post? I'm also trying to understand why web2py is intercepting the event and why it doesn't think the response is succesful which I assume is why the

Re: [web2py] Can I create an RSS Reader like Techi in web2py?

2014-08-13 Thread Ricardo Pedroso
Next weekend I can share the code. I have to cleanning it a little bit. Ricardo On 8/11/14, Gideon George wrote: > >> >> WOW! That's really great to hear. I don't even know how to start >> appreciating right now. > > I am really grateful for that, Absolutely grateful! I will love to learn > and

Re: [web2py] Re: bootstrap 3 - if you care help test trunk now

2014-08-13 Thread Ricardo Pedroso
I can make a patch in next friday/weekend, but you want a patch against what? What I've attached was a simple app showing two bootstrap3 formstyle alternatives. Should I patch the formstyle_bootstrap3 in sqlhtml.py? Ricardo On 8/11/14, Massimo Di Pierro wrote: > Would you send me this as a pa

[web2py] Re: Hypermedia API and Collection+JSON in web2py

2014-08-13 Thread Cliff Kachinske
Massimo, The new recipe you propose is "bottle+dal+validators+auth+collection" Could it be "bottle++validators+auth+collection? I have found myself needing to execute complex SQL queries. In this situation, in my opinion, psycopg2 would serve me just as well as dal. On Sunday, June 22, 2014

[web2py] Re: Strange ajax problem

2014-08-13 Thread Cliff Kachinske
get rid of the target in your ajax call and use ':eval' instead. Then reset the button in your response. On Sunday, May 4, 2014 9:33:05 AM UTC-4, John Drake wrote: > > I've created a simple ajax form to update a "post" database. For some > strange reason when I post a new message, the button gr

[web2py] Re: What is the right way to serve static files through a CDN ?

2014-08-13 Thread Cliff Kachinske
If, like me, you use the same static files on every page, just hard code them into layout.html. I realize this may make upgrading more, um, interesting, but it's much simpler than pattern-based routing. On Wednesday, August 13, 2014 11:23:52 AM UTC-4, Louis Amon wrote: > > I am using a CDN and

[web2py] Re: Strange ajax problem

2014-08-13 Thread Niphlod
you can use whatever you like it just needs to accomodate how web2py handles ajax. Without a complete example I can't tell what's going wrong with your own implementation. If you can, pack a minimal app to reproduce the behaviour On Wednesday, August 13, 2014 10:50:54 PM UTC+2, Michael Belle

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
Thanks Niphlod, I'm not using inline JS or explicitly using web2py.js. I'm using a Bootstrap Modal pretty much verbatim from the Bootstrap examples. It appears that web2py js is capturing the submit and disabling the button but not detecting the response and enabling the submit - is that corr

[web2py] Re: Strange ajax problem

2014-08-13 Thread Niphlod
the logic behind is suppressing double submission. web2py disables the submit button when you click on it until a proper response is returned. Don't EVER use inline javascript, and don't use web2py.js internal functions without proper knowledge of the inner workings :-P On Wednesday, August 1

[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Niphlod
there's no other way around it, in every programming language. You want to do something in a transaction, the db won't let you do it, you catch the exception (rollbacking) and deal with it. On Wednesday, August 13, 2014 7:30:58 PM UTC+2, Jack Kuan wrote: > > How does one usually deal with such c

[web2py] Seeking Experienced web2py Functional Tester

2014-08-13 Thread Mark Graves
Hey everyone! We are looking for a functional test script to be written for a web2py application for a small fee. We will provide a test environment, user access control list, list of URL's, expected results, and actual results. Results are behavioral in nature and will include modals. We are

Re: [web2py] web2py grid select all filtred rows

2014-08-13 Thread keiser1080
thanks for you reply. I will check tomorro at work. so on the controler i can get the rows by doing grid.rows? The query is also stored on an accessible grid proprety ? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code)

[web2py] Re: Strange ajax problem

2014-08-13 Thread Michael Beller
I just encountered the same problem. I'm using a Bootstrap Modal form and encountering the same problem - the form sends and receives data via AJAX but then adds the 'disabled' class to the button. I found this logic in web2py.js but I'm not clear on what's happening and why: // Form inpu

[web2py] Re: Issue 1961; redirect, response.headers and CAS

2014-08-13 Thread Massimo Di Pierro
Can you point me to any documentation? On Wednesday, 13 August 2014 04:52:00 UTC-5, Remco Boerma wrote: > > Thanks Massimo, > > Well, with CORS it depends. I used these to get CORS working with at IE11 > and Chrome (latest) > > response.headers['Access-Control-Allow-Origin'] > response.

Re: [web2py] Re: web2py shell vs terminal shell

2014-08-13 Thread Massimo Di Pierro
Please open a ticket about this. This is a major issue. Perhaps we should remove the web based shell. On Wednesday, 13 August 2014 02:41:17 UTC-5, Giacomo Dorigo wrote: > > Today I discovered an other problem with the admin shell. > If I execute command 1 > and then command 2, at this point it wi

[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Jack Kuan
How does one usually deal with such conflict? (two identical(except for id's) inserts causing a violation of an unique constraint) Isolating the insert into its own transaction and then do a db.commit(), catch any exception and then ignore? Thanks On Wednesday, August 13, 2014 10:57:13 AM UTC-

Re: [web2py] Re: web2py shell vs terminal shell

2014-08-13 Thread Giacomo Dorigo
Today I discovered an other problem with the admin shell. If I execute command 1 and then command 2, at this point it will re-execute command 1 too. If then I execute command 3, it will execute again also 1 and 2. This is while running web2py from source code on Windows with simple python web2py.

[web2py] Re: Login restricted based on subscription

2014-08-13 Thread Rufus
On Tuesday, August 12, 2014 4:28:11 PM UTC-4, Kenneth wrote: > > Hello everyone, > > I'm building a site that clients subscribes to so I need to limit their > login based on the subscription. Is there a built in feature to limit login > to a date range? > > > Kenneth > > Can't your successful log

[web2py] What is the right way to serve static files through a CDN ?

2014-08-13 Thread Louis Amon
I am using a CDN and am trying to configure web2py to use it instead of the classic static file service. So far I've been using pattern-based routes like this : cdn = 'https://xxx.cloudfront.net' routes_in = (... ('/static/$anything', cdn + '/static/$anything'),

Re: [web2py] Re: add static files to header from a module

2014-08-13 Thread Pablo Angulo
I also tried to place the > current.response.files.append(URL('static', > 'jqplot/jquery.jqplot.min.js')) > current.response.files.append(URL('static', > 'jqplot/jquery.jqplot.min.css')) > current.response.files.append(URL('static', > 'jqplot/plugins/jqplot.barRenderer.min.j

Re: [web2py] Re: add static files to header from a module

2014-08-13 Thread Pablo Angulo
El 13/08/14 a las #4, Leonel Câmara escribió: > Simply adding to current.response.files may not works if the request > is ajax (say your module is loaded). But it's not loaded via ajax, I call it like this: > @requires_get_arguments(('grupo', db.grupo), > ('productor', db.

Re: [web2py] Re: add static files to header from a module

2014-08-13 Thread Pablo Angulo
El 13/08/14 a las #4, Anthony escribió: > Can you show your module code? Are you doing the appending at the top > level in the module, or within a function/method? The latter: > # -*- coding: utf-8 -*- > # (C) Copyright (C) 2012-14 Pablo Angulo > # This file is part of karakolas . > > # karakolas

[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Niphlod
the problem in concurrency (andduplication) isn't the update part, it's the insert part On Wednesday, August 13, 2014 1:39:56 PM UTC+2, Leonel Câmara wrote: > > Couldn't he use a _for_update argument there to make this work in some > adapters? > > db.mytable.update_or_insert(q, name='test',

[web2py] Re: menu creation error

2014-08-13 Thread ocascante
The problem was the alphabetical order of models, thanks for the help El lunes, 11 de agosto de 2014 12:12:08 UTC-6, Leonel Câmara escribió: > > You made a typo: > > for row in db(db.categorias*.id > 0*).select(): > response.menu.append((T(row.nombre))) > > Fix in bold. > > BTW you probably wa

[web2py] Re: What am i doing wrong here? (virtualfields)

2014-08-13 Thread Anthony
> def new_style_virtual_field_test(): db = DAL('sqlite:memory',pool_size=1) > db.define_table('myorder', > Field('a','integer'), > Field('b','integer') > ) > db.myorder.c = Field.Virtual(lambda row:row.a * row.b) > db.myorder.insert(a=2,b=3) > return db().

[web2py] Re: add static files to header from a module

2014-08-13 Thread Anthony
Can you show your module code? Are you doing the appending at the top level in the module, or within a function/method? On Wednesday, August 13, 2014 7:14:46 AM UTC-4, pa...@cancamusa.net wrote: > > > Dear all: > In the process of moving functionality from models to modules, I'm trying > to add

[web2py] Re: add static files to header from a module

2014-08-13 Thread Leonel Câmara
Simply adding to current.response.files may not works if the request is ajax (say your module is loaded). In my modules I like to use a function the plugins in s-cubism.com use to set files: def _set_files(files): if current.request.ajax: current.response.js = (current.response.js o

[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Leonel Câmara
Couldn't he use a _for_update argument there to make this work in some adapters? db.mytable.update_or_insert(q, name='test', _for_update=True) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/w

Re: [web2py] Re: add static files to header from a module

2014-08-13 Thread Pablo Angulo
If I understand, you mean that whenever I call JQPlot jqplot = JQPlot(*args, col_represent=str) I have to append the following lines: response.files.append(URL('static', 'jqplot/jquery.jqplot.min.js')) response.files.append(URL('static', 'jqplot/jquery.jqplot.min.css'))

[web2py] Re: add static files to header from a module

2014-08-13 Thread Cliff Kachinske
Put the appending code in the controller. On Wednesday, August 13, 2014 7:14:46 AM UTC-4, pa...@cancamusa.net wrote: > > > Dear all: > In the process of moving functionality from models to modules, I'm trying > to add some filesto the header. When the file was in models, I did: > > respon

[web2py] add static files to header from a module

2014-08-13 Thread pang
Dear all: In the process of moving functionality from models to modules, I'm trying to add some filesto the header. When the file was in models, I did: response.files.append(URL('static', 'jqplot/jquery.jqplot.min.js')) response.files.append(URL('static', 'jqplot/jquery.jqplot.mi

[web2py] Re: RESTful PATCH request not working

2014-08-13 Thread Leonel Câmara
I've made some confusion with request.args, but the point still stands that you should be using args instead of request.args. I can tell you the restful decorator doesn't care if it's a PUT or a PATCH as it gets the method from request.env.http_method. So you're probably on the right track and

[web2py] Re: Issue 1961; redirect, response.headers and CAS

2014-08-13 Thread Remco Boerma
Thanks Massimo, Well, with CORS it depends. I used these to get CORS working with at IE11 and Chrome (latest) response.headers['Access-Control-Allow-Origin'] response.headers['Access-Control-Allow-Methods'] response.headers['Access-Control-Allow-Headers'] Maybe something more dy

[web2py] What am i doing wrong here? (virtualfields)

2014-08-13 Thread Remco Boerma
Hi all, I don't get the following errors and results. My goal is to have a virtual field and i can't get it to work the way i want it - and what i think is described in the book as it should work. What am i doing wrong here? Below are serveral independent samples of what i thought had to work

[web2py] Re: RESTful PATCH request not working

2014-08-13 Thread Falko Delarue
Ok just I tried this @request.restful() def page(): def PATCH(*args, **vars): if args[0]: print 'PATCH args: ', args But I still get a 400 "Bad Request" error (it does not say 400 "invalid arguments") that why I think it does not even come to this point. Also request.arg

[web2py] Re: question about db.mytable.update_or_insert()

2014-08-13 Thread Niphlod
that's basic versioning theory of databases. If you do two operations in two separate transactions that, in "english" can be translated as "if you don't find this record, please insert it", the two will happily succeed one after another if they are concurrent. That's why unique constraints are

[web2py] Use of mail.send in Scheduler

2014-08-13 Thread Prasad Muley
Hi, I want to use mail.send in Scheduler. Is there any way to use it in scheduler? AFAIK task which queued in scheduler.queue_task must be present in models/scheduler.py So how can I override mail.send() in models/scheduler.py -- Resources: - http://web2py.com - http://web2py.com/book (Do

[web2py] Re: Dynamic menu update

2014-08-13 Thread Richard
My conclusion is that the menu is becoming too large any performance improvement will have minimal user experience improvement. I'll create other menus's on locations where users are working at that time. Richard D On Tuesday, August 12, 2014 11:56:35 AM UTC+2, Richard wrote: > > Hello, > > I