[web2py] truly global/single instance variable

2014-07-26 Thread lucas
hello one and all, i need a little advice. i have a rather large table that i use to lookup hard unchangeable values. essentially is a big list of smaller lists. i know that each user has his/hers own session and that this lookup list is probably opened and stored multiple times, one for

[web2py] Re: truly global/single instance variable

2014-07-26 Thread Leonel Câmara
An easy way would be to store it in cache.ram. However, I would have to profile this to see if you have much of a performance gain versus simply defining the list in your models. It would definitely save memory but memory isn't the only concern. -- Resources: - http://web2py.com -

[web2py] Re: truly global/single instance variable

2014-07-26 Thread Anthony
Maybe put it in a module and import it. On Saturday, July 26, 2014 2:59:55 AM UTC-4, lucas wrote: hello one and all, i need a little advice. i have a rather large table that i use to lookup hard unchangeable values. essentially is a big list of smaller lists. i know that each user has

[web2py] Re: truly global/single instance variable

2014-07-26 Thread lucas
i have it in a module and under that module i have the variable setup as a global variable. wherein, if the variable is empty upon using it, i load the list of lists from a text file. if it is not empty, then i just use it. so in that case, is there just the single instance in memory, no

Re: [web2py] Re: truly global/single instance variable

2014-07-26 Thread Jonathan Lundell
On 26 Jul 2014, at 7:13 AM, lucas sjluk...@gmail.com wrote: i have it in a module and under that module i have the variable setup as a global variable. wherein, if the variable is empty upon using it, i load the list of lists from a text file. if it is not empty, then i just use it. so

[web2py] Re: truly global/single instance variable

2014-07-26 Thread Anthony
Rather than have your module code read a text file, you might also consider putting the data directly into the module itself (unless you need the text file to keep the data in a format more friendly to human editing): MY_LIST = [ ['item 1', 'item 2', 'etc.'], ... ] Anthony On

[web2py] Re: Can not import copy_reg

2014-07-26 Thread Richard
While setting up a new server I am wondering why previous versions of my app worked fine. What functionality triggers the custom_import? A temporarily solution might miss this functionality and I'll build this back when the hosting is in place again. On Friday, July 25, 2014 1:32:28 PM UTC+2,

[web2py] Re: Bootstrap is really killing web2py

2014-07-26 Thread 'sasogeek' via web2py-users
So... I'm not really sure what this whole conversation is about, as to whether it's an issue of web2py coming with bs2 by default or some difficulty in implementing bs3. I use bs3 just fine in my web2py apps and really haven't had any issues.. On Friday, 18 July 2014 19:17:34 UTC, Moustafa

[web2py] pre-populating the form in custom form

2014-07-26 Thread Luis Garcia
Hi! I am working with web2py and I am trying to pre-populate a form. In normal circumstances I do form.vars.field = value. But now, I am working with a custom form, and I realized that this does not work anymore. It is there any way to pre-populate a customized form directly from the server?

[web2py] Help! Invalid request when the url has special characters in it. e.g. - abcd%2Bfdf.jpg

2014-07-26 Thread kenny c
I am currently working on generating a jpg file and the filename contains special characters in it. when the link to image file is www.somedomain.com/abcd%2Bfdf.jpg It gives invalid request error. I am currently using request.args to read the filename. I tried to understand routes.py but I

[web2py] Re: Classic Error with Rocket - can't launch web2py any more

2014-07-26 Thread Dansant vzw
I finally tried it and received the following message: web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(pg8000), IMAP(imaplib) please visit:

[web2py] Re: google ndb

2014-07-26 Thread Alan Williams
Thank you for the quick response Massimo. I appreciate it. On Thursday, July 24, 2014 5:33:52 AM UTC-6, Massimo Di Pierro wrote: Yes it does. For example: db = DAL('google:datastore')# for google app engine datastore

[web2py] invalid request error when the url address contains special characters.

2014-07-26 Thread kenny c
I have a website link that has special characters in it, e.g) www.asdfasdf.com/5%pic.jpg If I try to open this link, I get invalid request error. The reason that the link ends with jpg extension is that I am creating a jpg file with a Python library. Any help would be great. I tried to play

[web2py] Re: Is it possible to step through scheduler task code in debugger?

2014-07-26 Thread Stephen Weiss
FWIW I did finally get it working, to an extent. I'm working on a Windows 7 machine to do this. In one command tool window, I'm running my web2py application. In another command tool window, I'm running the scheduler for my web2py application. In the model that contains the scheduled task that

[web2py] How to remove the symbol. What is the cause of its appearance?

2014-07-26 Thread Капылов Данил
When displaying text in some text at the end appears. and some do not. In this text there is no character. How to fix it was not? p {{if len(row.body)400:}} {{=(row.body[:401] + '. . .')}} {{else:}}

[web2py] LoginRadius - user cannot be logged in

2014-07-26 Thread Hakan Moray
Hi; I am using LoginRadiusAccount and I have configured loginradius.key properly (facebook login). But it seems that user cannot be logged in the web2py application although facebook login succeeds from LoginRadius side. Is there something else should be done in order to login the user to

Re: [web2py] invalid request error when the url address contains special characters.

2014-07-26 Thread Jonathan Lundell
On 26 Jul 2014, at 1:27 AM, kenny c firstclasske...@gmail.com wrote: I have a website link that has special characters in it, e.g) www.asdfasdf.com/5%pic.jpg If I try to open this link, I get invalid request error. The reason that the link ends with jpg extension is that I am creating a jpg

[web2py] How to prevent interactive shell from 303 error with redirect in model file.

2014-07-26 Thread Mark Li
I am currently redirecting my index page to another page (the splash page). The index page is the default function in my routes.py. The idea, is that if a user visits the index page, they will get redirected to the splash page, which works fine. At it's core, my redirect code looks like this

[web2py] Re: How to prevent interactive shell from 303 error with redirect in model file.

2014-07-26 Thread Anthony
Try: cmd_opts = request.global_settings.cmd_options if request.function==index and not (cmd_opts and (cmd_opts.shell or cmd_opts.scheduler)): redirect(URL('splash')) We should probably provide a more convenient method to check whether we have an http request vs. a shell or scheduler run