[web2py] Re: Weird problems generating menu from database

2017-07-29 Thread Вячеслав Анатольевич
Thanks for the answer, Massimo! But this example makes the menu items in one line with one drop-down menu item. Like this: Menuitem Menuitem - submenuitem- submenuitem I have three fields, they must be somthing like this (anothermenu - just for example - to under

[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: invalid

[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 "c:\web2py_sitio\gluon\shell.py",

[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 = db(t).

[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, ano

[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 Pier

[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) - https://code.google.com/p/web2py/issues/li

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 Datatab

[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) tha