[web2py] limit on username length without defining db.auth_user ?

2014-10-22 Thread LoveWeb2py
Hello -- simple question. Is it possible to set a username length with db.auth_user.username.requires = length 20 Something to that effect? By default users can create as long of a username as they want and I'd like to make it a little more secure. The book mentions redefining the auth.user ta

[web2py] web2py website error with Chinese user

2014-10-22 Thread Gael Princivalle
Hello all. I've got a Chinese user that complains he cannot login in a web2py website that I've done. He send me a printscreen where all CSS and Javascript are not loaded, so he can't login. If he use a VPN it's ok. Someone know why ? Perhaps it's due to Chinese network restrictions ? Thanks.

[web2py] Re: db.commit() taking too long to update records

2014-10-22 Thread Anthony
Instead of checking the timings in the console, check the timings during the actual Ajax request (maybe return the timings in some HTML and display it in the browser instead of just returning "OK"; or print the timings to the console). Are there any other Ajax requests that get fired before thi

[web2py] Re: Changing order of auth_user fields

2014-10-22 Thread Anthony
Well, you could manually define the entire table, but there should be an easier way. A bit of a hack, but alternatively, I think you can manipulate the order of field names in db.auth_user._fields. Anthony On Wednesday, October 22, 2014 10:24:05 PM UTC-4, Massimo Di Pierro wrote: > > Please op

[web2py] Re: janrain implementation

2014-10-22 Thread Massimo Di Pierro
You simply can't. The point of janrain is that you delegate authentication to them so they deal with credentials, not you. On Monday, 20 October 2014 13:02:16 UTC-5, mar...@hens-teeth.net wrote: > > Let me start by saying that I'm a total novice when it comes to both > web2py and janrain. I've i

[web2py] Re: Changing order of auth_user fields

2014-10-22 Thread Massimo Di Pierro
Please open a ticket about this. There is not a way but there should be. On Friday, 17 October 2014 16:50:37 UTC-5, Spokes wrote: > > I've added a middle name field to *auth_user* by doing the following: > > auth.settings.extra_fields['auth_user']= [ > Field('middle_name', type = "string", le

[web2py] Re: Configure web2py for catalan language

2014-10-22 Thread Massimo Di Pierro
It does not know how to pluralize the language. Look into some of the gluon/contrib/plural_rules/ for examples. On Thursday, 16 October 2014 07:46:00 UTC-5, Oscar Chic wrote: > > I try to add catalan language to web2py > When Create Language ca.py I get a new file ca.py but also an error " > glu

[web2py] Re: options widget

2014-10-22 Thread Massimo Di Pierro
It just adds a class to the input. How you render that class is up to you. On Thursday, 16 October 2014 03:38:53 UTC-5, Annet wrote: > > In a function I have: > > db.grp_membership.subgroupID.requires = > IS_IN_DB(db(db.grp_subgroup.groupID==groupID), 'grp_subgroup.id', > '%(name)s', zero='Selec

[web2py] Slower task scheduler performance

2014-10-22 Thread Carolina Nogueira
Hey guys, I have a performance question about the scheduler. My script is in python3 and when I run directly on a terminal, I have a response time about 2.55s. If I run exactly the same script inside a scheduler task with subprocess.check_output, my response time is increased by 100 times slow

[web2py] Re: Deployment

2014-10-22 Thread Jigar Mistry
Thank you for your answer! I am new to web2py.Will keep in mind this thing. On Saturday, 18 October 2014 07:50:17 UTC+5:30, Jigar Mistry wrote: > > Hello everyone, > > Is this possible to deploy single web2py app on nginx without web2py? > > > > Thanks, > Jigar Mistry > -- Resources: - http://we

[web2py] Re: Shopping cart concept without the payment

2014-10-22 Thread Joe
Hi Dave, Thanks so much for your help! I have been working on this and didn't get too far. I am trying to understand the syntax and the logic so I can learn how to do this and then apply it in an application I am working on just for my self of course. Here is where I am at the moment: I tried

[web2py] janrain implementation

2014-10-22 Thread marylou
Let me start by saying that I'm a total novice when it comes to both web2py and janrain. I've inherited a web2py application and have been tasked with setting up login such that the user can use either the existing login authorization method or facebook or google via janrain. I've used the info

[web2py] web2py scheduler error when I start the worker...

2014-10-22 Thread José Leite
Hello, I just started trying to use web2py scheduler to lauch tasks like DB updates or sending emails. I am using windows7 and web2py 2.9.11. I just added the following code to my project for a simple test: MODELS from gluon.scheduler import Scheduler from test_scheduler import Addition sched

[web2py] How to find the elements in a component using selenium

2014-10-22 Thread yang . chen
Hi, How could I find the elements in a component using selenium? In the html the component is shown like this: loading... Is there a method of selenium that can load the component, then the elements in the component can be located? Thanks! -- Resources: - http://web2py.com - http://web2py

[web2py] Re: Error starting up scheduler with postgresql - "type oid 114 not mapped to py"

2014-10-22 Thread Sebastian Echeverria
That solved my second problem. Thank you very much! Sebastian On Saturday, October 18, 2014 3:10:31 PM UTC-3, Niphlod wrote: > > update web2py to 2.9.11 please. > > On Saturday, October 18, 2014 5:13:46 AM UTC+2, Sebastian Echeverria wrote: >> >> Ok, so installing psycopg2 did make web2py use it

Re: [web2py] Re: We could have something like this

2014-10-22 Thread Carlos Costa
It does not the same thing but it does. It was intend to keep recipes, but one can post links to anything too. Thinking this way it is even better than meteorhelp. But the main difference I see is the dated layout, design and UX. It is a nice tool but already needs a refresh. 2014-10-21 11:23 GM

[web2py] SQLFORM.grid search: how to show only a subset of available search fields?

2014-10-22 Thread Jack Kuan
Hi, I'm using left=[...] when creating a searchable SQLFORM.grid. My problem is that the drop-down menu for choosing which fields to build the search query contains ALL the fields in the search result. Is there a way to limit it to only a subset of the fields like what the 'fields' argument of

Re: [web2py] Re: We could have something like this

2014-10-22 Thread Carlos Costa
We have Web2py Slices. http://www.web2pyslices.com 2014-10-20 19:41 GMT-02:00 António Ramos : > it was not a question. > we know everything is possible. > > Its just that finding info about web2py are sometimes dificult > > A site like this could help and also rate the source of info. > > Regard

[web2py] how to mock test redirect in gluon

2014-10-22 Thread Nguyen Huy
Dear all i want to mock test function in Gluon like Redirect that my controllers/default.py is using So I want to do @mock.path( default.gluon.http.redirect) . but i cant because :*** NameError: name 'auth' is not defined Im running my test by: python web2py.py -S app -M -R application

[web2py] Re: how to add a css file in web2py

2014-10-22 Thread Vikram Pudi
> > > Alternatively, if you're using web2py_ajax.html (which is included in the > layout.html head of the 'welcome' app), anywhere in your code (model, > controller, or view), you can do: > > response.files.append(URL('static', 'css/yourfile.css')) > > It did not work until I put this before

[web2py] How to add calendar to web2py and add events

2014-10-22 Thread Sneeky182
Hey, I'm looking at adding a calendar to my application for a business. I need to implement a page with a calendar on it. I also need to populate a database with events and get them to appear on the calendar when the calendar page is accessed. I've found a plugin called appointmentmanager but

[web2py] Re: Howto prepopulate a sqlform's drop-down field

2014-10-22 Thread Tim Sando
Wasn't wasted, as I needed to know how to do this, and your code worked! Cheers! (~3 years later...) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You

[web2py] Re: pymysql gives Broken Pipe

2014-10-22 Thread Bilal Hasan
Have there been any updates on this? I am in production environment using Web2Py 2.8.2 and this problem popped up randomly. On Tuesday, February 1, 2011 2:36:32 PM UTC-6, Fran wrote: > > I have been getting Broken Pipe issues with pymysql: > Traceback (most recent call last): > File "/home/we

[web2py] SSL configuration with built-in server

2014-10-22 Thread John Lofgren
Hi, all, I would like to configure web2py to use SSL with the built-in web server. The examples I have found (e.g. http://www.web2py.com/AlterEgo/default/show/140) show to pass the cert and key on the command line with the -c and -k options. So, two questions: 1) Is there a way to set the cert

[web2py] How to find elements in a component by selenium

2014-10-22 Thread yang . chen
Hi, How could I find the elements in a component using selenium? In the html the component is shown like this: loading... Is there a method of selenium that can load the component, then the elements in the component can be located? Thanks! -- Resources: - http://web2py.com - http://web2py

[web2py] plugin_jstree - ImportError: No module named globals

2014-10-22 Thread Alen Cerovic
I am getting error with plugin_jstree on windows: Traceback (most recent call last): File "gluon/restricted.py", line 224, in restricted File "C:/mediacom/mediacom/Development/web2py/web2py_win/web2py/applications/staff/controllers/plugin_jstree.py", line 49, in File "gluon/globals.py",

Re: [web2py] Re: db.commit() taking too long to update records

2014-10-22 Thread Luciano Laporta Podazza
By the way, I've already tried the SQL query manually and it works perfectly. I'm using Web2py 2.9.11 and I'm starting to think that perhaps there's an issue with web2py services. Any ideas?. Thanks On Wed, Oct 22, 2014 at 10:30 PM, Luciano Laporta Podazza < lucianopoda...@gmail.com> wrote: > Hi

[web2py] Re: db.commit() taking too long to update records

2014-10-22 Thread Luciano Laporta Podazza
Hi Niphlod, I did what you say and if I try doing the query through console it works perfectly and fast: >>> db._timings [('SET FOREIGN_KEY_CHECKS=1;', 0.0002541542053222656), ("SET sql_mode='NO_BACKSLASH_ESCAPES';", 0.0002338886260986328)] >>> db((db.alerts.alerts_id==1)&(db.alerts.archive

[web2py] Re: RESTful request args/vars with JSON array

2014-10-22 Thread Henry Nguyen
For posterity's sake, I was able to retrieve the array in the request body by using: import json my_list = json.loads(request.body.read()) and then iterating through the list items just like any other list. This was taken from http://web2py.com/books/default/chapter/29/04#request under request

Re: [web2py] Re: Support for MS Access?

2014-10-22 Thread Dave S
On Wednesday, October 22, 2014 4:54:17 AM UTC-7, Carlos Correia wrote: [...] > > yes I know access mdb is an awfull db. But is used by another old vb > program and > > we need to reed this db too. Is very dificult to change the old program. > > [...] > > Yes, follow Leonel's advice, and

[web2py] pg8000 unexpected EOF on client connection with an open transaction

2014-10-22 Thread 'Michael Gheith' via web2py-users
Hello web2py community, I have a scheduled task that gets executed every 5 minutes by the web2py scheduler. It runs perfectly, no errors. The DBA has noticed the following message in the PostgreSQL logs every 5 minutes: unexpected EOF on client connection with an open transaction Any ideas w

[web2py] Re: unittest with multiple test files

2014-10-22 Thread David Ripplinger
I figured out another option, which I like and will use for now. I'm sharing on here in case anyone is interested. I just learned about execfile. Basically, I have a runtests.py file with: import unittest import glob db = testDb suite = unittest.TestSuite() for file in glob.glob('applications/my

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread Niphlod
nice catch. https://github.com/web2py/web2py/pull/535 On Wednesday, October 22, 2014 10:48:40 PM UTC+2, David Ripplinger wrote: > > Yep, it works. Good job. > > On Wednesday, October 22, 2014 4:41:31 PM UTC-4, Niphlod wrote: >> >> got the issue, reproduced it, fixed it. I forgot about web2py.exe n

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
Yep, it works. Good job. On Wednesday, October 22, 2014 4:41:31 PM UTC-4, Niphlod wrote: > > got the issue, reproduced it, fixed it. I forgot about web2py.exe not > being actually web2py.py recompiled but a loader that decompresses > library.zip and loads the modules. This is a complete rebuild

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread Niphlod
got the issue, reproduced it, fixed it. I forgot about web2py.exe not being actually web2py.py recompiled but a loader that decompresses library.zip and loads the modules. This is a complete rebuild on 2.9.11 with the fix. https://www.dropbox.com/s/jmdy2qtt71i0snb/web2py_win.zip?dl=0 On Wednesd

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
Here's some more information. You may have already figured this out, but just in case it helps: When I run web2py.exe from a different directory, that directory also gets populated with new, empty folders such as 'applications' and 'site-packages'. This, along with the error message about not f

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread Niphlod
whoopsy. it needs also the corresponding library.zip. stay tuned, I'll try to make something against 2.9.11. On Wednesday, October 22, 2014 10:12:34 PM UTC+2, David Ripplinger wrote: > > Tried it. It does the same thing. Sorry. > > On Wednesday, October 22, 2014 4:01:32 PM UTC-4, Niphlod wrote: >

[web2py] Re: Access DAL from outside script

2014-10-22 Thread Anthony
You should make sure it's accessing the correct file and that the table really exists in that database. Anthony On Wednesday, October 22, 2014 3:26:50 PM UTC-4, Richard wrote: > > But I am refering to an existing database with data in that table. When I > put the line db(db.langu.id>0).select(

Re: [web2py] Re: web2py setup scripts for windows

2014-10-22 Thread Tim Richardson
If you are interested to RDP in to the server just let me know. My summary so far is that IIS appears to be doing something dynamic which causes the request thread to crash when .py files are created under its doc root. I can't get any logging of what goes wrong. No python exception is raised. On 2

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
Tried it. It does the same thing. Sorry. On Wednesday, October 22, 2014 4:01:32 PM UTC-4, Niphlod wrote: > > try this instead https://www.dropbox.com/s/jd4oxlilmel8ghz/web2py.exe?dl=0 > > On Wednesday, October 22, 2014 9:03:34 PM UTC+2, Niphlod wrote: >> >> uhm. they should behave in the same way.

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread Niphlod
try this instead https://www.dropbox.com/s/jd4oxlilmel8ghz/web2py.exe?dl=0 On Wednesday, October 22, 2014 9:03:34 PM UTC+2, Niphlod wrote: > > uhm. they should behave in the same way. investigating... > > On Wednesday, October 22, 2014 6:11:56 PM UTC+2, David Ripplinger wrote: >> >> I recently

[web2py] Correction for setup-web2py-heroku.sh script

2014-10-22 Thread Jay Martin
Currently the setup-web2py-heroku.sh script includes these commands: sudo pip install virtualenv sudo pip install psycopg2 virtualenv venv --distribute source venv/bin/activate pip freeze > requirements.txt Shouldn't we want to install psycopg2 into the virtualenv named venv by moving the psyc

[web2py] Re: Access DAL from outside script

2014-10-22 Thread Richard
But I am refering to an existing database with data in that table. When I put the line db(db.langu.id>0).select() in db.py in the app wemanops_test 3 records are returned. I expect that the model on an existing db would expose the data. On Wednesday, October 22, 2014 4:58:59 PM UTC+2, Rich

[web2py] Re: working directory and runtime directory when running web2py

2014-10-22 Thread Niphlod
uhm. they should behave in the same way. investigating... On Wednesday, October 22, 2014 6:11:56 PM UTC+2, David Ripplinger wrote: > > I recently discovered there are a couple things about the working > directory and the runtime directory when running web2py. > >- If you launch "python we

[web2py] Re: Access DAL from outside script

2014-10-22 Thread Anthony
An operational error indicates the db is reporting that the table doesn't exist in the database itself (i.e., you have a model of the table, but there is no such table in the db). Anthony On Wednesday, October 22, 2014 1:03:18 PM UTC-4, Richard wrote: > > Anthony, > > Thank you, I do not need a

[web2py] Re: Access DAL from outside script

2014-10-22 Thread Richard
Anthony, Thank you, I do not need access to Auth yet. Having stripped the code to the following: import os import sys import datetime import calendar from datetime import date, time sys.path.append("c:\python27\web2py") from gluon.sql import * from gluon.validators import * module_pat

[web2py] Re: ImportError: No module named myapp.modules

2014-10-22 Thread Alex
finally I could solve the problem. The __init__.py file was missing in the application folder ( __init__.py file in modules folder was already there so I thought that would be enough). -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (

[web2py] working directory and runtime directory when running web2py

2014-10-22 Thread David Ripplinger
I recently discovered there are a couple things about the working directory and the runtime directory when running web2py. - If you launch "python web2py.py" in Linux from a working directory other than "web2py", the runtime directory is "web2py" and not your working directory. This wo

[web2py] Re: Access DAL from outside script

2014-10-22 Thread Anthony
See http://stackoverflow.com/a/26495214/440323. The problem is not with db access or the DAL but with Auth -- it requires the web2py current object (including request, response, session, and T). If you really need Auth, you should run your script via the web2py command line: python web2py.py -

Re: [web2py] Re: Scheduler tasks won't run

2014-10-22 Thread Jim Steil
I think the problem was that I copied my production database over the top of my development db. Looks like my newer version of web2py has a new table called scheduler_task_deps that my production system doesn't yet have. Thanks for the time on create/migrate of the db tables. I removed the table

[web2py] Re: Scheduler tasks won't run

2014-10-22 Thread Niphlod
" error assigning tasks " with type ERROR is a pretty big pointer. Usually this happens when you don't let the scheduler migrate/create the tables. On Wednesday, October 22, 2014 4:58:09 PM UTC+2, Jim S wrote: > > I'm using the web2py scheduler. I've used it before without problems but > all of

[web2py] Access DAL from outside script

2014-10-22 Thread Richard
Hi, I want to access an existing database from an outside web2py app script because the database must be input to Orange for data mining. I tried the following defining but dot not get access top the data: import os import sys import datetime import calendar from datetime import date, time

[web2py] Scheduler tasks won't run

2014-10-22 Thread Jim S
I'm using the web2py scheduler. I've used it before without problems but all of a sudden it won't run my tasks. When I run from the command line I get this the output in the attached screenshot. The other screenshot is the record in the scheduler_task table showing my queued task. And, my co

[web2py] Re: web2py setup scripts for windows

2014-10-22 Thread Niphlod
I'll be joining this discussion as soon as I get time to install a fresh system. ATM I can't replicate your issues, but TBF I tested the creation of applications only 2008r2 and 2012 and no 2012r2 (where I did a fast check to ensure it was running like on 2012) On Wednesday, October 22, 2014 1:

[web2py] Re: Dropbox: 2 comments, 1 question

2014-10-22 Thread Anthony
> > (3) From the book:​ > ​Create a file called "yourapp/private/dropbox.key" and in it write > > ::app_folder > > where and are your key and secret.​ > > *My question: what app_folder should be used?* > The app from which you will be using the API. Anthony -- Resources: - http://web2py.co

Re: [web2py] Re: Support for MS Access?

2014-10-22 Thread Carlos Correia
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22-10-2014 12:15, ksotiris wrote: > > Τη Δευτέρα, 20 Οκτωβρίου 2014 8:56:24 μ.μ. UTC+3, ο χρήστης Leonel Câmara > έγραψε: > > Either way, just convert your access database to anything else, it's bound > to be better for your sanity. Serio

[web2py] Re: web2py setup scripts for windows

2014-10-22 Thread Tim Richardson
My monologue continues ... I found something interesting by accident. If the directory that the controller tries to write to is not under the document root of the website , then there is no problem. It merrily writes .py files. I discovered this because I have a controller which does the same

[web2py] Re: Support for MS Access?

2014-10-22 Thread ksotiris
Τη Δευτέρα, 20 Οκτωβρίου 2014 8:56:24 μ.μ. UTC+3, ο χρήστης Leonel Câmara έγραψε: > > Either way, just convert your access database to anything else, it's bound > to be better for your sanity. Seriously, any time spent migrating is better > spent than making access work with web2py. > > yes I k

[web2py] Dropbox: 2 comments, 1 question

2014-10-22 Thread Martin Weissenboeck
I want to use the Dropbox API. (1) It should be mentioned, that the dropbox sdk has to be installed. Here are the instructions: https://www.dropbox.com/developers/core/sdks/python ​(2) It is neceessary to create a Dropbox API app to get the keys https://www.dropbox.com/developers/apps/create?ap