Re: [web2py] Re: Nonetype Error

2018-06-28 Thread Maurice Waka
My apologies.I got carried away by an issue. Cotroller code: from applications.service.main import get_word, get_name, get_index, testing def views: corpus = [get_name, get_words, get_index, testing]##imported functions result = ''.join(y for y in [x() for x in corpus] if y is not None)

[web2py] Re: dependencies inside 'static' folder

2018-06-28 Thread pbreit
Anthony, et al, with this question and the other similar one in regards to Vue it seems like we need a solid, standard way to implement client-side JavaScript libraries. Are the options pretty much: 1) routes.py and 2) relative URLs? And then where to store the library (ie, in /static or use a

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2018-06-28 Thread Anthony
On Thursday, June 28, 2018 at 10:34:47 AM UTC-4, Artem wrote: > > Dear Antony , > From your example : > query = ' OR '.join(str(db.product.id == i) for i in [list of ids]) > result type(query) is a string , could you tell me how to correctly > convert it to the pydal.objects.Query / Set ? > I'

[web2py] Re: Nonetype Error

2018-06-28 Thread Leonel Câmara
Maurice telling me corpus is defined in the controller doesn't help me at all, I need to see how you are picking the functions you put there to see why one could be None. A possible reason is that you have a dictionary of keys with a function as the value of each key, you then do a get from that

Re: [web2py] Re: Nonetype Error

2018-06-28 Thread Maurice Waka
Corpus is defined in the controller. On Thu, 28 Jun 2018, 20:55 Leonel Câmara wrote: > Where and how is the list of functions to be called (corpus) defined? The > mistake is obviously there as one of the values in corpus is not a function > it's a None. > > Also if the functions sometimes return

[web2py] Re: Nonetype Error

2018-06-28 Thread Leonel Câmara
Where and how is the list of functions to be called (corpus) defined? The mistake is obviously there as one of the values in corpus is not a function it's a None. Also if the functions sometimes return a None value (the error would be different but) you cannot join them like that since None

[web2py] Re: Infinite loading

2018-06-28 Thread Leonel Câmara
You should probably use the intersection observer now but here's a particularly stupid way to do it (also because it fires for every scroll). var scroll_threshold = 500; // make sure you leave enough for any elements after the one where you are loading elements such as a footer document.onscrol

[web2py] Nonetype Error

2018-06-28 Thread Maurice Waka
Am calling functions from a list as follows: ''.join([x() for x in corpus]) A function could be like this: def findWholeWord(w): return re.compile(r'\b({0})\b'.format(w), flags=re.IGNORECASE).search item = ['ii'] fnval = ['i', 'we', 'cake', 'love', 'time', ] fadmin = ['admin','give',] G3 =

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2018-06-28 Thread Artem
Dear Antony , >From your example : query = ' OR '.join(str(db.product.id == i) for i in [list of ids]) result type(query) is a string , could you tell me how to correctly convert it to the pydal.objects.Query / Set ? I'm trying query = db(query) , and get a pydal.objects.Set , but can't use i

Re: [web2py] Re: Infinite loading

2018-06-28 Thread Carlos Cesar Caballero Díaz
Thanks Dave, I'm looking. Greetings. El 27/06/18 a las 16:11, Dave S escribió: On Wednesday, June 27, 2018 at 6:33:28 AM UTC-7, Leonel Câmara wrote: Do you mean that as you scroll more results are loaded? This isn't really a web2py problem, it's a matter of implementing it in ja

Re: [web2py] Re: Infinite loading

2018-06-28 Thread Carlos Cesar Caballero Díaz
Hi Leonel, thanks for your answer, I know that's not a web2py problem, I was asking if someone has built a plugin or something including that feature, for example, I work also with the Yii2 PHP framework, and there is: https://github.com/kop/yii2-scroll-pager Greetings. El 27/06/18 a las 09: