[web2py] Re: belongs handle if there is only one value

2017-07-28 Thread Massimo Di Pierro
if not isinstance(test0, (tuple, list)): test0 = [test0] query = (db.test1.test0.belongs(test0) ) On Friday, 28 July 2017 20:31:25 UTC-5, 黄祥 wrote: > > is it possible belongs to handle if there is only one value? > e.g. > *models/db.py* > db.define_table('test0', > Field('name'), > format = '%(n

[web2py] Re: MySQL and web2py error 1103

2017-07-28 Thread Massimo Di Pierro
Is this with the latest version? 2.15.2? On Friday, 28 July 2017 11:13:23 UTC-5, Jorgeluis Ortega wrote: > > Hi, I'm working with web2py for some months, which seems to be a very > interesting tool. > I want to know if there is the possibility of manipulating MySQL data from my > app inventor

[web2py] Re: MS-SQL DAL Problem

2017-07-28 Thread Massimo Di Pierro
This seems like a serious issue. Are you available to help us debug via chat? On Wednesday, 26 July 2017 09:41:58 UTC-5, Jaco wrote: > > Hi all, > since updating from 2.14.6 to 2.15.2 I have a problem with accessing a > remote MS-SQL Database. It does not recognize certain fields and always >

[web2py] Re: how to use sum() in grid

2017-07-28 Thread Massimo Di Pierro
There is no easy way but I just made a commit that fixes your problem. If you use trunk or wait for a next web2py version (within days) and you can do: def stck_issue_manage(): #form = SQLFORM.smartgrid(db.t_stck_issue,onupdate=auth.archive) grid = SQLFORM.grid(db.t_stck_issue) if gr

[web2py] belongs handle if there is only one value

2017-07-28 Thread 黄祥
is it possible belongs to handle if there is only one value? e.g. *models/db.py* db.define_table('test0', Field('name'), format = '%(name)s') db.define_table('test1', Field('name'), Field('test0', 'reference test0'), format = '%(name)s') *controllers/default.py* def install(): if db(db.test0).is

[web2py] Re: to XML() or to JSON.parse() ?

2017-07-28 Thread Anthony
Yes, as usual, if you want to prevent escaping in the view, you must wrap with XML(). Another options is: Controller: return dict(stra='abcd', obj=alist) # No JSON conversion needed here. View: {{=ASSIGNJS(o=obj)}} ... The ASSIGNJS helper will handle everything. Anthony On Friday, July

[web2py] Execution error of script sessions2trash

2017-07-28 Thread domezzzz
Version: 2.15.2-stable+timestamp.2017.07.19.12.18.41 web2py.exe for windows Start logging-- File "c:\web2py_sitio\gluon\shell.py", line 268, in run execfile(startfile, _env) File "sc

[web2py] Re: to XML() or to JSON.parse() ?

2017-07-28 Thread Pierre
Yes I want to execute a view here is the example code: Controller: from json import dumps as jdumps def abtest(): alist = ["it's ok","I'm late"] return dict(stra='abcd', obj=jdumps(alist)) View: {{extend 'layout.html'}} Ceci est le modèle test/abtest.html RESULT var o= "{{=obj}

Re: [web2py] Datatables Query String Parsing

2017-07-28 Thread José Luis Redrejo
I have used it several times, I thought of doing a reusable class for it, but did't have time to do it yet. For a query with only one table involved this is one code example. I use the same code, with a small modifications in the way field values are requested, for queries with joined tables. That

[web2py] Re: Controller View Question

2017-07-28 Thread Stuart Rolinson
Yes you can do this. what you need to do is use either the scheduled task function or the another queuing system, such as celery. The web2py scheduler works well for most scenarios. The flow will go something like this:- 1. User access the front end app and request a scheduled action or long

[web2py] MySQL and web2py error 1103

2017-07-28 Thread Jorgeluis Ortega
Hi, I'm working with web2py for some months, which seems to be a very interesting tool. I want to know if there is the possibility of manipulating MySQL data from my app inventor through web2py. I have tried a few methods but it gives me an error 1103 unable to post or put the text. I want t

[web2py] Integrating existing web2py with GitHub

2017-07-28 Thread William Ross
Hello, I have an existing web2py project that I edit through the admin interface. To backup the project I am manually pushing that code to a GitHub. I saw that under the 'Manage' tab there are options to 'Git Pull' and 'Git Push' which requires the gitpython module. Looking through threads on t

[web2py] Re: to XML() or to JSON.parse() ?

2017-07-28 Thread Anthony
Whenever an action returns a dictionary, web2py looks for and executes an associated view (and if a view is not found, it uses a generic view if the generic view has been enabled). Are you returning a dictionary because you want to execute a view, or do you simply want to return the entire dict

[web2py] to XML() or to JSON.parse() ?

2017-07-28 Thread Pierre
Hi everyone, I'd prefer JSON.parse() but in most case i have to fall back on XML() for example given a list alist= ["it's ok","I'm late"] If an AJAX function returns something of the form: return json.dumps(dict(alist=alist, astring='abcd')) then JSON.parse() can cope with it howew

[web2py] web2py uwsgi spooler with imported models

2017-07-28 Thread Zbigniew Pomianowski
Hi Evryone, Has anyone tried to use uwsgi spooler with loaded models? I import env from gluon.shell. Max what I did accomplish was built environment, but without imported models. When I try to import them, nothing happens. I suppose RestrictedError is raised and sys.exit() is executed inside th

Re: [web2py] Datatables Query String Parsing

2017-07-28 Thread Richard Vézina
Here they talk about data structure and list seems possible : https://datatables.net/manual/server-side#Example-data Richard On Fri, Jul 28, 2017 at 8:52 AM, Richard Vézina wrote: > Hello Villas, > > The subject interrest me, as I use DTs, but not the server-side feature... > But, I am not sure

Re: [web2py] Datatables Query String Parsing

2017-07-28 Thread Richard Vézina
Hello Villas, The subject interrest me, as I use DTs, but not the server-side feature... But, I am not sure what you want to achieve... I gonna read a bit about DTs server-side, waiting for precision from you and maybe will understand better your question then... Richard On Thu, Jul 27, 2017 a

[web2py] Re: Testing error

2017-07-28 Thread Pierre
looks like the ajax target function is faulty. perhaps it tries to reload web2py.js. Or the ajax call might be wrong (the error message says it wants asynchronous and you give it synchronous call). who's the boss ? :) -- Resources: - http://web2py.com - http://web2py.com/book (Documentatio