Re: [web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Manuele Pesenti
Il 18/08/14 15:24, Niphlod ha scritto: > StringIO. Can you be more explicit? Please! Thanks a lot Manuele -- 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)

[web2py] Shouldn't request.is_local be false when a web2py behind apache being accessed by remote client?

2014-08-18 Thread Ray (a.k.a. Iceberg)
Hi web2py big family, I thought I had been using web2py for long enough but, still got stumbled by this little issue. :-) I setup web2py behind apache (using the default setup script on webfaction.com, if that matters). My site works, except the request.is_local is always True. Here comes some

[web2py] Re: using FORM with new line layout

2014-08-18 Thread Anthony
There are a number of options. You could insert breaks in between (i.e., using the BR helper), wrap each input in a DIV(), or create an HTML table and put each input in a table row. Anthony On Sunday, August 17, 2014 6:37:22 PM UTC-4, sid datta wrote: > > > HI - I wanted to customize the layout

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Anthony
On Monday, August 18, 2014 11:55:43 AM UTC-4, Paolo Valleri wrote: > > The first issue is that, I don't know a simple way (using sqlform.grid) to > return to the form even if the validation has passed successfully. > Maybe something like: SQLFORM.grid(..., oncreate=lambda form: redirect(URL(args

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Niphlod
well, there's a reason why those are called "database callbacks". Those are the lower-side of things when you need to put a check somewhere. They have nothing to do with forms or grids, and IMHO, they should stay as they are until a proper "resolution" is found for the common issue of multiple p

Re: [web2py] Web2py Forms and Javascript

2014-08-18 Thread Richard Vézina
Don't know where you get so far, but I post the code example I talked about on this thread : https://groups.google.com/d/msg/web2py/oiyOIC0IH04/6-NvVOJECU8J The example is for phone numbers, but you can reuse it for anything else. I use that code for one to many relation with normalized db schema

Re: [web2py] one-to-many relations and form for crerate records

2014-08-18 Thread Richard Vézina
# Controller def phone_numbers_form(): user_id = None if request.args(0) is not None: try: user_id = int(request.args(0)) except ValueError: user_id = db(db.auth_user.username == request.args(0)).select( db.auth_user.id).first().id if user_id is

[web2py] How to alter attributes of multiple elements with the same prefix, in a form

2014-08-18 Thread Mark Li
I am currently trying to alter all the ID's of the elements in the auth.login() form. Basically, I want to add a prefix or suffix to all the elements that have an ID. All of the id's (except for the submit button row), are prefixed with "auth_user_". Is it possible to use form.elements() to sel

Re: [web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Paolo Valleri
The first issue is that, I don't know a simple way (using sqlform.grid) to return to the form even if the validation has passed successfully. The second is to display the error message. Maybe we can add an error_message parameter to _before_* ? Paolo 2014-08-18 17:35 GMT+02:00 Anthony : > So,

[web2py] Re: DAL Select

2014-08-18 Thread Tom Russell
Thanks. I did originally did iterate through the rows but like this approach better since I know only one row will always match. On Monday, August 18, 2014 11:16:25 AM UTC-4, Anthony wrote: > > .select() returns a Rows object, even if it contains just a single row. > Instead, it should be: > > r

[web2py] Re: _before_* with SQLFORM.grid

2014-08-18 Thread Anthony
So, you want to add some logic to SQLFORM.accepts so if an insert or update fails after validation passes, the form still reports an error? Would you specify the error message in the call to SQLFORM.accepts? Anthony On Monday, August 18, 2014 11:25:32 AM UTC-4, Paolo Valleri wrote: > > Hi all,

[web2py] _before_* with SQLFORM.grid

2014-08-18 Thread Paolo Valleri
Hi all, a common problem is a constraint on multiple fields. There are few ways to handle this situation, I tried by using the _before_* callbacks. Currently, if the the callback return True (which means that the constrains validation is failed) the sqlform.grid doesn't raise any message or not

[web2py] Re: DAL Select

2014-08-18 Thread Anthony
.select() returns a Rows object, even if it contains just a single row. Instead, it should be: row = db(db.voltrin.startdate == mydate).select()[0] or better: row = db(db.voltrin.startdate == mydate).select().first() .first() returns None in case no records are returned, which would cause an

[web2py] Re: DAL Select

2014-08-18 Thread Niphlod
a select returns a LIST of row(s). either you do row = db(whatever).select().first() print row.some_field or rows = db(whatever).select() for row in rows: print row.some_field On Monday, August 18, 2014 5:09:37 PM UTC+2, Tom Russell wrote: > > I have some simple code that is suppose to g

[web2py] DAL Select

2014-08-18 Thread Tom Russell
I have some simple code that is suppose to grab data from a row in my db table. I do it like: row = db(db.voltrin.startdate == mydate).select() vwtrin = row.vw_trin I have run this and verified mydate and whatever other variables I have are something other than null but I cannot seem to get th

Re: [web2py] Nginx and uwsgi Internal Server Error

2014-08-18 Thread Richard Vézina
Good to know! There seems to have an improved version though : https://groups.google.com/d/msg/web2py/8YWJU4FCdwg/_tm_TQKr1GQJ Richard On Fri, Aug 8, 2014 at 6:25 PM, Cliff Kachinske wrote: > Richard, > > I used the ubuntu install script on a VPS at Digital Ocean. No problem. > > > On Friday

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Niphlod
StringIO. On Monday, August 18, 2014 2:52:40 PM UTC+2, Manuele wrote: > > Il 18/08/14 12:24, Niphlod ha scritto: > > fetch it, store it in some folder, stream it to the client. > uhm... ok but if the resource is not static? > In the meanwhile, waiting an answare, I developped a proxy using a >

Re: [web2py] Re: web2py 2.6.4 mysql migration problem

2014-08-18 Thread Vinicius Assef
Actually, the message says the table has a key greater than 767 bytes. On Mon, Aug 18, 2014 at 9:01 AM, Diogo Munaro wrote: > You have a lot of indexes into one table > > Em segunda-feira, 23 de setembro de 2013 08h47min08s UTC-3, frasse escreveu: >> >> Hi All >> I try to follow migration recomme

Re: [web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Manuele Pesenti
Il 18/08/14 12:24, Niphlod ha scritto: > fetch it, store it in some folder, stream it to the client. uhm... ok but if the resource is not static? In the meanwhile, waiting an answare, I developped a proxy using a controller based on the requests library that seams works... even if it looks quite sl

[web2py] MySQL will never migrate this way (not alter table problem)

2014-08-18 Thread Diogo Munaro
Hey guys, I'm trying to do CI (continuous integration) on web2py application. I really need automatic database migration and web2py is really good with it, but using MySQL I notice that we have some caveats

[web2py] Re: web2py 2.6.4 mysql migration problem

2014-08-18 Thread Diogo Munaro
You have a lot of indexes into one table Em segunda-feira, 23 de setembro de 2013 08h47min08s UTC-3, frasse escreveu: > > Hi All > I try to follow migration recommendation for mysql in web2py 2.6.4 . as > follow > >1. I am setting migrate_enabled=False >2. everything is ok >3. len

[web2py] Re: web2py app as proxy... but how?

2014-08-18 Thread Niphlod
fetch it, store it in some folder, stream it to the client. On Friday, August 15, 2014 9:32:43 PM UTC+2, Manuele wrote: > > Hi! > I need to use my web2py application to link some web resources that the > server that hosts my application can reach via vpn and proxy them to the > client (not in t

[web2py] Re: Using cache for improving pagination recipe in the manual?

2014-08-18 Thread Niphlod
if you're presenting 10 rows at a time and expecting the user to navigate 30 pages, "you're doing it wrong", from the UX side of things. On the other side, there's no reason to cache "in advance" something the user will never ask. Let the cache be the cache. If you need to "warm it up", just do

[web2py] Re: scheduler timeouts on successful tasks

2014-08-18 Thread Niphlod
you're probably facing problems updating the status of the running task. If your' eusing SQLite, this might happen because it suffers blocking for concurrent writes. if you enable the DEBUG logging, you'll probably see where it gets stuck. On Monday, August 18, 2014 3:01:15 AM UTC+2, Brad Mille