[web2py] Re: blocking all access but america

2015-11-11 Thread Niphlod
what you want to do is technically called geofencing. At the moment, there are no other ways to "locate" a user if not inspecting the remote ip address, so all "methods" you want to implement share the common "requirement" of a ip-->country mapping On Wednesday, November 11, 2015 at 7:02:07 AM

[web2py] Re: Scheduler not reassigning task after restart

2015-11-11 Thread Niphlod
this is handled automatically by each and every worker every 5 cycles (with default heartbeat of 3 seconds, it's 15 seconds). You can "force" the job that is done every 5 cycles setting "PICK" as a status on the workers. That being said, if it doesn't add up in your environment you'd better

[web2py] Re: TypeError: an integer is required

2015-11-11 Thread Anthony
datetime.date() is for constructing a date object and it takes integer arguments (for the year, month, and day) -- you don't pass a date to it. Instead, just do: SPAN(v, ...) Or if you don't like the default format you get when the date is converted to a string, use the .strftime method:

Re: [web2py] Re: Web2py / Pydal Time Fields

2015-11-11 Thread Mark Graves
What about changing the format specification to allow for the format so you could still have the time there. The only problem I thought I saw is that stripping off ms is built into a number of pydal adapters (I think -- might be wrong) With that, it would in theory allow backward compatibility

[web2py] Re: Processing text file into html output

2015-11-11 Thread Anthony
with open(os.path.join(request.folder, 'static',"words", "words.txt"), 'r') as infile: content = CAT() for line in infile: s = SPAN(line, _class="body") content += P(s) The CAT() helper is for concatenating other helpers without wrapping them in an

[web2py] Re: Web2py / Pydal Time Fields

2015-11-11 Thread Anthony
On Wednesday, November 11, 2015 at 10:25:03 AM UTC-5, Massimo Di Pierro wrote: > > in retrospect this was a poor design decision, but we cannot change it for > backward compatibility. > Maybe we should add a new field type (e.g., "time_with_ms" or "ms_time"). Anthony -- Resources: -

[web2py] no puedo ver los codigos de ejemplos en la aplicacion

2015-11-11 Thread raul elias sosa
hola a todos queria saber si hay alguna forma de ver los codigos que aparecen en el default , por que no los puedo ver cada ves que quiero editar psra verlos -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Processing text file into html output

2015-11-11 Thread Brendan
I would like to programmatically take text files in the controller, format them (per paragraph with spans and p) and pass them to a view as {{=content}}. The helpers seem to be designed to prevent me from doing that (eg can't accumulate them one at a time into the string content).

[web2py] Select and display database data

2015-11-11 Thread Patrik Skřivánek
Hello all, I am looking for best way how to get and display data from database. On the internet I didn't find good and simple solution. For example: What is code for get and display data from table org_organisation (field 'name')? -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] Finding all rows within x meters of a geoPoint

2015-11-11 Thread Boa
I'd like to find all table entries within x meters of a certain location. The DAL object in question uses the spatialite adapter (my system's spatialite library is the most recent version), and the field of interest is of type 'geometry': db = DAL('spatialite://...') db.define_table('point',

[web2py] Survey app (that allows the user to go offline to answer the survey)

2015-11-11 Thread artdijk
LS, How feasible is it to make a survey app as web page that uses local storage on the client to store the page and the answers ? The case description is: The client goes to the survey webpage. The webpage is stored in local storage. The user completes the survey whenever he wants no matter if

Re: [web2py] Re: web2py and python3

2015-11-11 Thread Massimo Di Pierro
As of today python 3 is used almost exclusively in schools. Do you know of any large company that uses Python 3? I do not. But I know many large companies that use Python 2, including banks. On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote: > > Great one Alex. > > While

[web2py] Re: Finding all rows within x meters of a geoPoint

2015-11-11 Thread Massimo Di Pierro
I think it is Field('loc','geometry') and Field('loc','geography') without the (). On Wednesday, 11 November 2015 08:51:48 UTC-6, Boa wrote: > > I'd like to find all table entries within x meters of a certain location. > The DAL object in question uses the spatialite adapter (my system's >

Re: [web2py] CONF2PY

2015-11-11 Thread Richard Vézina
I guess there is things not compatible with recent version of web2py... 2010... It just yesterday... :-P Richard On Wed, Nov 11, 2015 at 7:24 AM, Laurent Lc wrote: > Could you tell me why it is impossible to run this app. > If i want to create an user it crash the app ..

[web2py] Re: enable automatic login after email verification

2015-11-11 Thread Massimo Di Pierro
Actually on a second thought auth.settings.registration_requires_verification = True auth.settings.login_after_registration = True does what you asked already. No? On Wednesday, 11 November 2015 09:04:15 UTC-6, Massimo Di Pierro wrote: > > This is tricky to do without changing the current

[web2py] Re: Field set the default value +1 on insert

2015-11-11 Thread Massimo Di Pierro
Also you would have to requires the Field('ticket',...,unique=True) because this method it not thread safe and you should be prepared that inserts may fail. On Tuesday, 10 November 2015 11:42:40 UTC-6, Niphlod wrote: > > if you want to have a number that strictly: > > - is incremental (no

[web2py] Re: DAL returns string fields not as unicode strings

2015-11-11 Thread Massimo Di Pierro
The strings you get are probably UTF8. Can you confirm? On Wednesday, 4 November 2015 08:19:41 UTC-6, Dandelion Mine wrote: > > Hello! > According to Web2py book, 'by default web2py uses utf8 character encoding > for databases'. I get the contrary results: there are fields with type > 'string',

[web2py] Re: Survey app (that allows the user to go offline to answer the survey)

2015-11-11 Thread Massimo Di Pierro
Yes it is possible. You would have to store the stats in JS and store with localstorage, On Wednesday, 11 November 2015 08:51:48 UTC-6, artd...@xs4all.nl wrote: > > LS, > How feasible is it to make a survey app as web page that uses local > storage on the client to store the page and the

[web2py] Re: auth tables not visible in appadmin

2015-11-11 Thread Massimo Di Pierro
It is possible you have a db = DAL(...) in some other model file and that overrides the db variable from db.py On Wednesday, 4 November 2015 08:19:41 UTC-6, Red Beard wrote: > > Hi, > > My problem is that the auth tables do not appear in appadmin, though the > system allows me to register

[web2py] Re: dbstats with oracle doesn't show sql selects or timing

2015-11-11 Thread Massimo Di Pierro
Please open a ticket. On Saturday, 7 November 2015 20:16:17 UTC-6, tomt wrote: > > Hi, > > I'm using web2py 2.12.3 connecting to oracle 10.2 > I tried to use the dbstat function of {{=response.toolbar()}} to examine > database performance, but the sql select and its timing isn't printed. >

[web2py] Re: stepofweb theme layouts?

2015-11-11 Thread Massimo Di Pierro
No layout plugin. I works as with any other template. Remove the PHP tags, copy index.html into layout.html. Fix the links to static files (put them in static) and add the web2py tags {{...}} as exampled in the book. On Tuesday, 10 November 2015 16:03:39 UTC-6, pumplerod wrote: > > I'm coming

[web2py] Re: Routes problem?

2015-11-11 Thread Massimo Di Pierro
I would use the old style regex routes for this or (better) use the rewrite module in the web server (apache/nginx). The new style router has some odd behavior with multiple apps which we cannot change for backward compatibility. On Wednesday, 11 November 2015 07:37:31 UTC-6, Gael Princivalle

Re: [web2py] Re: Compute insert-only

2015-11-11 Thread Massimo Di Pierro
I see the problem, the computed field is computed by the insert function while f in the _after_insert_delivery_order are the record parameters as passed to the insert function (before the field is computed). So I'd say this is not supposed to work. Open a ticket with your code and we will

[web2py] Re: enable automatic login after email verification

2015-11-11 Thread Massimo Di Pierro
This is tricky to do without changing the current auth code. So I did, please check it: auth.settings.login_once_after_registration = True On Thursday, 5 November 2015 07:54:55 UTC-6, arihant daga wrote: > > I want users to enable automatically login after email verification but > not

[web2py] Re: Web2py / Pydal Time Fields

2015-11-11 Thread Massimo Di Pierro
in retrospect this was a poor design decision, but we cannot change it for backward compatibility. On Wednesday, 4 November 2015 23:53:05 UTC-6, Mark Graves wrote: > > Hey everyone, > > I find myself in the need for microsecond level precision for time fields > where I am querying over those

[web2py] Re: Question regarding conf2py registration bug

2015-11-11 Thread Massimo Di Pierro
Did not use it in a while. Traceback? On Wednesday, 11 November 2015 06:11:32 UTC-6, Laurent Lc wrote: > > idem > > Le lundi 11 novembre 2013 22:14:46 UTC+1, Jaeseong You a écrit : >> >> The conf2py seems to suffer from a crash when one is trying to register. >> Is there any past resolution of

Re: [web2py] Re: web2py and python3

2015-11-11 Thread António Ramos
What banks? can you share that info ? 2015-11-11 15:21 GMT+00:00 Massimo Di Pierro : > As of today python 3 is used almost exclusively in schools. Do you know of > any large company that uses Python 3? I do not. But I know many large > companies that use Python 2,

[web2py] Re: Select and display database data

2015-11-11 Thread Massimo Di Pierro
Did you define this table? is it pre-existing? What is the model? On Wednesday, 11 November 2015 08:51:48 UTC-6, Patrik Skřivánek wrote: > > Hello all, > > I am looking for best way how to get and display data from database. On > the internet I didn't find good and simple solution. > > For

[web2py] Re: Question regarding conf2py registration bug

2015-11-11 Thread Laurent Lc
idem Le lundi 11 novembre 2013 22:14:46 UTC+1, Jaeseong You a écrit : > > The conf2py seems to suffer from a crash when one is trying to register. > Is there any past resolution of this bug? Would it be possible for you to > help me clarify the problem? > -- Resources: - http://web2py.com -

[web2py] CONF2PY

2015-11-11 Thread Laurent Lc
Could you tell me why it is impossible to run this app. If i want to create an user it crash the app .. Th os where i ve installed this app is a debian Thank you The most recent version is 2010 ? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Routes problem?

2015-11-11 Thread Gael Princivalle
Someone have an idea ? How can I resolve it? Il giorno martedì 10 novembre 2015 16:51:37 UTC+1, Gael Princivalle ha scritto: > > I don't know why but this button have never works in my both web2py > installations. I restart the server for reloading the routes.py file. And > yes I've done it. >

[web2py] multiple variables return from controller

2015-11-11 Thread Ron Chatterjee
I am looking at Massimo's my_forum app. in function definition I have: def do(): id, method = request.args(0,cast=int), request.args(1) if method == 'report': db(db.post.id==id).update(reported=True) return 'reported' if method == 'like_it' and (DEBUG or

[web2py] Re: Scheduler not reassigning task after restart

2015-11-11 Thread Benson Myrtil
This problem appeared to fix itself. I woke up this morning and all the task were finally reassigned. Thanks! On Tuesday, November 10, 2015 at 3:33:38 PM UTC-5, Benson Myrtil wrote: > > I am running on a windows server 2008. I have nssm setup which manages my > 4 worker nodes. The workers

[web2py] Re: Scheduler not reassigning task after restart

2015-11-11 Thread Benson Myrtil
Thank you for the tip about changing the status to PICK. Ill use that next time if this ever occurs again. On Wednesday, November 11, 2015 at 5:25:30 AM UTC-5, Niphlod wrote: > > this is handled automatically by each and every worker every 5 cycles > (with default heartbeat of 3 seconds, it's

[web2py] Re: invalid field value

2015-11-11 Thread Anthony
On Wednesday, November 11, 2015 at 4:40:17 PM UTC-5, Pierre wrote: > > items = db().select(db.c_sub.ALL) > form = SQLFORM.factory(*[Field(item.name, type='boolean', > default=False, comment=item.c_main.name) for item in items]) > The IS_SLUG validation of values you are inserting into

[web2py] Re: invalid field value

2015-11-11 Thread Anthony
> When I input a composed value for that field like : fruit-apple > > I get this when reading the corresponding table to compose a form > Field: invalid field name: fruit-apple, > use rname for "funny" names > Please show the code you are using to "read the corresponding table to compose a

Re: [web2py] CONF2PY

2015-11-11 Thread Laurent Lc
Thank you Is there a new version of conf2py or à similar app ? Le 11 nov. 2015 3:56 PM, "Richard Vézina" a écrit : > I guess there is things not compatible with recent version of web2py... > 2010... It just yesterday... :-P > > Richard > > On Wed, Nov 11, 2015 at

Re: [web2py] CONF2PY

2015-11-11 Thread Richard Vézina
Massimo's answer another post about that... He is the author and didn't use it since a wild... Your best guess, go to github request an old version of web2py dating from 2010 and try the app again in these old version (even version from later may works you have to test what the latest version

[web2py] invalid field value

2015-11-11 Thread Pierre
Hi all, I have a field definition in a table like this Field('name',requires=(IS_SLUG(check=True, error_message='must be a slug'),IS_LOWER())) When I input a composed value for that field like : fruit-apple I get this when reading the corresponding table to compose a form

Re: [web2py] CONF2PY

2015-11-11 Thread Anthony
web2py aims to maintain backward compatibility, so it *should* still run under the current version of web2py. We'll need more details to figure out the problem though. Please provide the exact steps you are taking as well as the traceback. Anthony On Wednesday, November 11, 2015 at 3:20:01 PM

Re: [web2py] CONF2PY

2015-11-11 Thread Richard Vézina
Possible issue : represent=lambda value*, row*: ... Back in time row were not required... On Wed, Nov 11, 2015 at 3:23 PM, Anthony wrote: > web2py aims to maintain backward compatibility, so it *should* still run > under the current version of web2py. We'll need more

Re: [web2py] Re: Compute insert-only

2015-11-11 Thread 黄祥
done https://github.com/web2py/web2py/issues/1101 thanks and best regards, stifan On Wednesday, November 11, 2015 at 9:59:12 PM UTC+7, Massimo Di Pierro wrote: > > I see the problem, the computed field is computed by the insert function > while f in the _after_insert_delivery_order are the

[web2py] Re: multiple variables return from controller

2015-11-11 Thread Ron Chatterjee
Replying to my own post. I just looked up Massimos previous answer. And the correct return policy is: query1 = (db.auth_user.id == db.liked.liked_by); all_like = db(query1).select(db.auth_user.first_name); items = [dict(name = row.first_name) for row in

[web2py] Re: TypeError: an integer is required

2015-11-11 Thread Anthony Smith
Thanks Anthony, you guys are a great assistance to all the newbies cheers On Wednesday, 11 November 2015 23:30:54 UTC+11, Anthony wrote: > > datetime.date() is for constructing a date object and it takes integer > arguments (for the year, month, and day) -- you don't pass a date to it. >

[web2py] Re: invalid field value

2015-11-11 Thread Pierre
items = db().select(db.c_sub.ALL) form = SQLFORM.factory(*[Field(item.name, type='boolean', default=False, comment=item.c_main.name) for item in items]) Le mercredi 11 novembre 2015 20:47:21 UTC+1, Anthony a écrit : > > > When I input a composed value for that field like : fruit-apple

[web2py] Re: Survey app (that allows the user to go offline to answer the survey)

2015-11-11 Thread Dave S
On Wednesday, November 11, 2015 at 7:37:15 AM UTC-8, Massimo Di Pierro wrote: > > Yes it is possible. You would have to store the stats in JS and store with > localstorage, > > What needs to happen to handle being back online? Would automatic refreshes work for that, or would they break

[web2py] Re: Processing text file into html output

2015-11-11 Thread Dave S
On Wednesday, November 11, 2015 at 9:10:11 AM UTC-8, Anthony wrote: > > with open(os.path.join(request.folder, 'static',"words", "words.txt"), > 'r') as infile: > content = CAT() > for line in infile: > s = SPAN(line, _class="body") > content += P(s) >

Re: [web2py] CONF2PY

2015-11-11 Thread Anthony
On Wednesday, November 11, 2015 at 3:37:19 PM UTC-5, Richard wrote: > > Possible issue : > > represent=lambda value*, row*: ... > > Back in time row were not required... > It was changed in a backward compatible way, so if you have a represent function that takes only a single value, just the