[web2py] Re: web2py setup scripts for windows

2014-09-04 Thread Massimo Di Pierro
Is your point that we should not use these script or that we should not provide scripts for windows at all? In the first case, what would you change? In the second case, why not? On Wednesday, 3 September 2014 10:11:29 UTC-5, Niphlod wrote: > > hell no. I don't want 7-zip installed by web2py. a

[web2py] Re: Is this still true about keyed tables?

2014-09-04 Thread Massimo Di Pierro
I do not recall adding support for other databases. On Thursday, 4 September 2014 16:56:02 UTC-5, Anthony wrote: > > From the book: > > > *Currently keyed tables are only supported for DB2, MS-SQL, Ingres and > Informix, but others engines will be added.* > > Aren't other engines supported now as

[web2py] Re: Version 2.9.6 indeed breaks backward compat for some users

2014-09-04 Thread Massimo Di Pierro
I do not like this. Should we put to a vote the default behavior of db(...).like(...)? the thing is whatever we do will behave differently than before on different databases. On Wednesday, 3 September 2014 11:11:27 UTC-5, Anthony wrote: > > On Wednesday, September 3, 2014 9:37:24 AM UTC-4, Mass

[web2py] Re: 2.9.6 broke custom view template delimiters

2014-09-04 Thread Massimo Di Pierro
posted in 2.9.7. Thank you. :-) On Thursday, 4 September 2014 06:02:59 UTC-5, Jonathan New wrote: > > Hi Massimo, > > I had sent a pull request proposing changes to lines 282-290 to > > if delimiters != self.default_delimiters: > escaped_delimiters = (escape(delimiters[0]), >

[web2py] Re: Extremely slow raw SQL queries on web2py

2014-09-04 Thread Massimo Di Pierro
Very strange. What do you think is causing this? On Wednesday, 3 September 2014 09:44:17 UTC-5, Mehmet A. wrote: > > *db.executesql()* takes 30 seconds to return a result, despite the fact > that same query takes 0.5-1 second if I try it on the MySQL console or with > the same code on the web2py

Re: [web2py] self-reference table IS_IN_DB and set

2014-09-04 Thread Annet
What about : def set_requirement(dummy_table): db.dummy_table.field2.requires=IS_IN_DB(..) db.define_table('dummy_table', Field(...), Field(...), on_define = set_requirement) Kind regards, Annet -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://

[web2py] web2py 2.9.7 is OUT

2014-09-04 Thread Massimo Di Pierro
same as 2.9.6 except: - a few more bug fixes - sessions are stores in sessions/XX/YY/ subfolder to avoid proliferation of files under the same folder which causes slowdown - cache.disk has been rewritten by Leonel and it much better. -- Resources: - http://web2py.com - http://web2py.com/book (D

[web2py] Re: web2py list of dictionaries

2014-09-04 Thread trr
Thanks for the solution, Joe, Leonel, Stefaan. To continue, why should I create a new dictionary. My idea was to use one dictionary and populate it with all data. Will that not be more efficient? Thank you once again. On Wednesday, September 3, 2014 5:15:40 PM UTC+5:30, trr wrote: > > In control

[web2py] sqlform.grid default search value

2014-09-04 Thread Douglas Campbell
Is it possible to have a default search value in an sqlform.grid? I do not see the option in the docs and have not figured out a work around. What I truly want to do is have the page JUST load the search bar and not the database results. Then once a search term is entered it shows the results i

[web2py] Re: using AJAX to transfer json objects

2014-09-04 Thread Jason Solack
That works! Thank you very much On Thursday, September 4, 2014 2:59:58 PM UTC-4, Niphlod wrote: > > > from gluon.serializers import json > def thebackend(): > thedict = dict(a=1, b=2) > return json(thedict) > > > > $.getJSON('/appname/default/thebackend.json', function(data) > {conso

Re: [web2py] getting " [Errno 13] Permission denied" over and over

2014-09-04 Thread JorgeH
It seems to have something to do with Traceback (most recent call last): File "/home/mdipierro/make_web2py/web2py/gluon/restricted.py", line 220, in restricted File "C:/web2py/applications/ZenuToolkit/models/zenu.py" , li

[web2py] Is this still true about keyed tables?

2014-09-04 Thread Anthony
>From the book: *Currently keyed tables are only supported for DB2, MS-SQL, Ingres and Informix, but others engines will be added.* Aren't other engines supported now as well? Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] self-reference table IS_IN_DB and set

2014-09-04 Thread Derek
Just set that up after you define the table. On Thursday, September 4, 2014 1:53:05 PM UTC-7, Richard wrote: > > Hello, > > I have a weird case where I need to make a self reference on a table but I > need to filter out the list of table entries present in my drop down. > > # Model > dummy_sub_se

[web2py] self-reference table IS_IN_DB and set

2014-09-04 Thread Richard
Hello, I have a weird case where I need to make a self reference on a table but I need to filter out the list of table entries present in my drop down. # Model dummy_sub_select_set = db(db.dummy_table.field1 == True) # Not working dummy_sub_select_set = lambda: db(db.dummy_table.field1 == True)

[web2py] Geraldo Report

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear All. Does anyone use Geraldo Report? I am trying to use i follow the how to about web2py and Geraldo http://www.geraldoreports.org/docs/tutorial-2.html But i received a empty pdf. My code: controllers/callscltes_pdf.py def callcltes_pdf(): from reports import ReportPurchase

[web2py] Re: using AJAX to transfer json objects

2014-09-04 Thread Niphlod
from gluon.serializers import json def thebackend(): thedict = dict(a=1, b=2) return json(thedict) $.getJSON('/appname/default/thebackend', function(data) {console.log(data)}) On Thursday, September 4, 2014 3:52:01 PM UTC+2, Jason Solack wrote: > > > Hello everyone, I'm hoping so

[web2py] Re: JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Henry Nguyen
Just for posterity's sake, I put the check into a custom decorator and used that new decorator instead: def requires_login(function): def check_is_logged_in(*args, **kwargs): if not auth.is_logged_in(): raise HTTP(401, json.dumps(dict(content='Unauthorized.'))) re

[web2py] Re: JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Henry Nguyen
That is definitely a viable option... not as clean as the decorator but certainly functional. Thank you Leonel :) Henry On Thursday, September 4, 2014 11:17:47 AM UTC-7, Leonel Câmara wrote: > > Ohh, in this case, instead of modifying tools.py I would drop the > auth.requires_login() decorator

[web2py] Re: JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Leonel Câmara
Ohh, in this case, instead of modifying tools.py I would drop the auth.requires_login() decorator and use auth.is_logged_in to check inside the function. Something like: @request.restful() def api(): def GET(*args,**vars): return dict() def POST(*args,**vars): return dic

[web2py] Re: JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Henry Nguyen
Primarily because I would like to display custom messages sent from the API, and I want them controllable from the API side. Specifically, our UI framework has a feature built in which allows us to display custom messages from the API by specifying the message characteristics in the response bo

[web2py] Re: JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Leonel Câmara
Why? Why don't you simply analyse the HTTP return code where you're calling the API? -- 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 me

[web2py] Live preview, with COLT + Sublime Text, server config?

2014-09-04 Thread Jean-Paul McCoy
How can I use CodeOrchestraRPCHttpServer with Web2py? COLT live preview is all html and Java so it must be doable. The COLT server opens one port for itself then a second for the live coding session. Should I attempt to hack the COLT side to proxy through Rocket, or can I just get Web2py to rec

[web2py] using AJAX to transfer json objects

2014-09-04 Thread Jason Solack
Hello everyone, I'm hoping someone might be able to provide an example of how to use the web2py ajax API to transfer json data from the server to the client side javascript. Any help would be appreciated! Thank you Jason -- Resources: - http://web2py.com - http://web2py.com/book (Documen

[web2py] Extremely slow raw SQL queries on web2py

2014-09-04 Thread Mehmet A.
*db.executesql()* takes 30 seconds to return a result, despite the fact that same query takes 0.5-1 second if I try it on the MySQL console or with the same code on the web2py debug console or on the web2py shell. I tried the following cases: ... #Irrelevant part of the code raw_data = dbs.e

[web2py] Store a file using Crud

2014-09-04 Thread Manu Grandío
Hi! I want to allow users to store files in my web application by both these methods: - By uploading the file from their hard drives - By providing a URL where the file is located. Then, there's no upload and the controller downloads the file and inserts it in the database. I know how

[web2py] SQLFROM.grid sorting question

2014-09-04 Thread yamauchi shohei
Hello, I'm new to web2py, and I just recently created a SQLFORM.grid that displays a grid very well. I'm having an issue with Sorting though (out of the box). My URL to this page contains a parameter (ID) like "~/sitename/controllername/id" But the sorting does not include "id" in the URL so th

[web2py] JSON response on auth.settings.on_failed_authentication with @request.restful()

2014-09-04 Thread Henry Nguyen
I have a method decorated with the following decorators: @request.restful() @auth.requires_login() On an unauthenticated (non-logged-in) request, I get a 403 response with "Not authorized" in the response body, per default settings. I would like to be able to modify this response to be JSON. I

Re: [web2py] getting " [Errno 13] Permission denied" over and over

2014-09-04 Thread JorgeH
It's on Windows. The default user. On Thursday, September 4, 2014 2:22:47 AM UTC-5, Johann Spies wrote: > > On 3 September 2014 23:31, JorgeH > wrote: > > I discovered that by cleaning errors, cache and sessions, its work again. >> But now Im getting the error like every other time I test. >> >>

Re: [web2py] Re: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Dear, i changed datetime with 'datetime' and now it's works Thank You On Thursday, September 4, 2014 8:15 AM, Niphlod wrote: tat's probabl why replace datetime with 'datetime' (notice the '') On Thursday, September 4, 2014 1:37:51 PM UTC+2, visuallinux wrote: Hi. > > >The database def

Re: [web2py] Re: Version 2.9.6 indeed breaks backward compat for some users

2014-09-04 Thread Philip Kilner
Hi Anthony, On 03/09/14 17:11, Anthony wrote: I wonder if we should add an option to set that database-wide -- something like DAL(..., case_sensitive_like=False). +1 from me! Also, should .startswith and .endswith have a case sensitive option? +1 again, but much less pressing, at least f

[web2py] Re: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread Niphlod
tat's probabl why replace *datetime* with *'datetime'* (notice the *''*) On Thursday, September 4, 2014 1:37:51 PM UTC+2, visuallinux wrote: > > Hi. > > The database definition ; > > > db.define_table('cdr', > Field('caller_id_name',length=30), > Field('caller_id_number',length

[web2py] Re: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread 'FERNANDO VILLARROEL' via web2py-users
Hi. The database definition ; db.define_table('cdr', Field('caller_id_name',length=30), Field('caller_id_number',length=30), Field('destination_number',length=30), Field('context',length=20), Field('start_stamp', datetime), Field('answer_stamp', da

[web2py] Re: 2.9.6 broke custom view template delimiters

2014-09-04 Thread Jonathan New
Hi Massimo, I propose changing lines 282-290 to if delimiters != self.default_delimiters: escaped_delimiters = (escape(delimiters[0]), escape(delimiters[1])) self.r_tag = compile(r'(%s.*?%s)' % escaped_delimiters, DOTALL)

[web2py] Re: 2.9.6 broke custom view template delimiters

2014-09-04 Thread Jonathan New
Unfortunately, the latest patch (Version 2.9.6-stable+timestamp.2014.09.02.01.57.55) doesn't solve the problem. line 282: if delimiters is None: delimiters = context.get('response', {})\ .get('app_settings',{}).get('template_delimiters') However, delimiters wi

[web2py] Re: SQLFORM.smartgrid 'module' object has no attribute 'split'

2014-09-04 Thread Niphlod
what's the table definition of db.cdr ? On Thursday, September 4, 2014 4:29:17 AM UTC+2, visuallinux wrote: > > Hi All. > > I am trying to use SQLFORM.smartgrid: > > query=(db.cdr.accountcode==form.vars.nombre[0]) > > grid=SQLFORM.smartgrid(db.cdr,constraints=dict(cdr=query),details=False,create=F

Re: [web2py] getting " [Errno 13] Permission denied" over and over

2014-09-04 Thread Johann Spies
On 3 September 2014 23:31, JorgeH wrote: I discovered that by cleaning errors, cache and sessions, its work again. > But now Im getting the error like every other time I test. > > Any hints?? > > Which user owns web2py/applications//models? Regards Johann -- Because experiencing your loyal lov