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

2017-07-29 Thread 黄祥
if test0 != None and type(test0) == str: query = (db.test1.test0 == test0) elif test0 != None and type(test0) == list: query = (db.test1.test0.belongs(test0) ) else: query = (db.test1.id > 0) return error traceback when access http://127.0.0.1:8000/a/default/test1?test0=None# *ValueError:

[web2py] Re: Execution error of script sessions2trash

2017-07-29 Thread domezzzz
El viernes, 28 de julio de 2017, 17:07:21 (UTC-3), dome escribió: > > Version: 2.15.2-stable+timestamp.2017.07.19.12.18.41 > > web2py.exe for windows > > Start logging-- >File

[web2py] Re: Weird problems generating menu from database

2017-07-29 Thread Massimo Di Pierro
Let me assume there is only one level and this cannot be arbitrarily nested. Also I assume the initial model of this thread: db.define_table('store_catalog', Field('maincategory', 'string'), Field('subcategory', 'string'), Field('description', 'text')) t = store_catalog rows =

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

2017-07-29 Thread Massimo Di Pierro
shouldn't this be: if test0 != None and type(test0) == str: query = (db.test1.test0 == test0) elif test0 != None and type(test0) == list: query = (db.test1.test0.belongs(test0) ) else: query = (db.test1.id > 0) On Saturday, 29 July 2017 02:27:41 UTC-5, 黄祥 wrote: > > thx 4 the way out massimo,

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2017-07-29 Thread Oasis Agano
Hello, Can you add me too? Name: Oasis AGANO Software developer/consultant & Digital Nomad. I've been using web2py since 2014. I will share my site later(work in progress). meanwhile my email is oasisag...@gmail.com. kr, Oasis On Monday, February 16, 2015 at 12:21:36 AM UTC+2, Massimo Di

[web2py] Re: Weird problems generating menu from database

2017-07-29 Thread Вячеслав Анатольевич
Hi! Paraphrase the question, can anyone explain how to create a drop-down menu from a database table or show a working example? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Datatables Query String Parsing

2017-07-29 Thread villas
Thanks for responses and José that code will be a good help. In my case, parsing the query is quite trivial to extract a search string and the sort order, which is all I needed just now. After playing around more, it seems to me that Web2py would be really improved with something like

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

2017-07-29 Thread 黄祥
thx 4 the way out massimo, another way is to use if condition that check the data type *e.g.* if test0 != 'None' and type(test0) == 'str': query = (db.test1.test0 == test0) elif test0 != 'None' and type(test0) == 'list': query = (db.test1.test0.belongs(test0) ) else: query = (db.test1.id > 0)

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

2017-07-29 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 =

[web2py] Re: MySQL and web2py error 1103

2017-07-29 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-29 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-29 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