[web2py] Re: web2py as Grafana endpoint

2016-11-28 Thread Dave S
On Monday, November 28, 2016 at 3:23:59 PM UTC-8, Massimo Di Pierro wrote: > > response from web2py controller? web2py returns bytes. It is up to you to > put utf8 or ascii in there. web2y does not care. > > > Okay, I overrode the Content-Type header to remove the "charset: utf-8", and I set enfo

[web2py] Re: apply constraint on SQLFORM.grid buttons

2016-11-28 Thread 黄祥
a, u right, sorry, my bad, thanks for the correction, anthony. best regards, stifan -- 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 received this mes

[web2py] Re: Docs and SQLTABLE

2016-11-28 Thread Dave S
On Monday, November 28, 2016 at 3:24:48 PM UTC-8, Massimo Di Pierro wrote: > > I am not sure SQLTABLE is very useful. I think looping and making your own > table is a more common pattern. > Well, that would let me do the green-bar stuff, but either SQLTABLE should be findable in the docs, or i

[web2py] Re: Storing rows

2016-11-28 Thread Dave S
On Monday, November 28, 2016 at 8:46:03 PM UTC-8, Anthony wrote: > > Building a table by hand was what I did in one of my first web2py >> projects. Not hard, but not as convenient as the tools can make it ... for >> normal cases, at least. >> >> I'll see if I can get back to the "nearly working"

[web2py] admin does not work with tablet on pythonanywhere

2016-11-28 Thread leone
Goodmorning everyone. I downloaded an application on pythonanywhere. It works both on the tablet and on PC. But if I try to perform admin it works perfectly on PC while on the tablet shows a blank page. You can give me some information about it? -- Resources: - http://web2py.com - http://web2py

[web2py] Re: Storing rows

2016-11-28 Thread Anthony
> > Building a table by hand was what I did in one of my first web2py > projects. Not hard, but not as convenient as the tools can make it ... for > normal cases, at least. > > I'll see if I can get back to the "nearly working" Storage example, and > using the constructor more knowledgeably..

[web2py] Re: apply constraint on SQLFORM.grid buttons

2016-11-28 Thread Anthony
On Monday, November 28, 2016 at 6:47:21 PM UTC-5, 黄祥 wrote: > > pls try (not tested) : > def grid_constraints(): > table = db.test > query = table.created_by == auth.user_id > constraints = dict(test = query) > editable = True if query else False > No, that won't work -- "query" is a Query object,

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
On Monday, November 28, 2016 at 10:22:53 PM UTC-5, Áureo Dias Neto wrote: > > Friend, it worked perfectly! thank you! > > Now, I want to do the inverse of this query, ie select vehicles from the > vehicles table, which have no reference in some record in the table of > photos, ie want to select v

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
Friend, it worked perfectly! thank you! Now, I want to do the inverse of this query, ie select vehicles from the vehicles table, which have no reference in some record in the table of photos, ie want to select vehicles that do not have photos .. could you help me? -- Resources: - http://web2py.c

[web2py] Re: apply constraint on SQLFORM.grid buttons

2016-11-28 Thread 黄祥
pls try (not tested) : def grid_constraints(): table = db.test query = table.created_by == auth.user_id constraints = dict(test = query) editable = True if query else False #editable = True grid = SQLFORM.smartgrid(table, constraints = constraints, editable = editable) return locals() ref: http://

[web2py] apply constraint on SQLFORM.grid buttons

2016-11-28 Thread Junaid Ahmed
I want to allow permission to only the logged in user to edit his/her own tuples in the SQLFORM grid. Currently even if I'm logged in as a different user I'm able to edit the other person's information. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Re: Docs and SQLTABLE

2016-11-28 Thread Massimo Di Pierro
I am not sure SQLTABLE is very useful. I think looping and making your own table is a more common pattern. On Monday, 28 November 2016 03:30:14 UTC-6, Dave S wrote: > > The first mention of SQLTABLE in the book seems to be in Chapter 6, under > Table Constructor, format attribute, without much t

[web2py] Re: web2py as Grafana endpoint

2016-11-28 Thread Massimo Di Pierro
response from web2py controller? web2py returns bytes. It is up to you to put utf8 or ascii in there. web2y does not care. On Monday, 28 November 2016 01:08:20 UTC-6, Dave S wrote: > > Any suggestions on how to force the response to ASCII instead of UFT-8? > > /dps > > > On Tuesday, November 22,

[web2py] Re: S3 Fineuploader with web2py

2016-11-28 Thread Massimo Di Pierro
What you trying to do excately? Upload from web2py forms to S3? Than you do: easy_install pyfilesystem >>> import fs.s3fs >>> myfs = fs.s3fs.S3FS(bucket, prefix, aws_access_ke, aws_secret_key) >>> db.define_table('test',Field('file','upload',uploadfs = myfs)) On Monday, 28 November 2016 00:58:3

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Dave S
On Monday, November 28, 2016 at 9:24:22 AM UTC-8, Mike Stephenson wrote: > > I am not getting the day of the month > > On Monday, November 28, 2016 at 10:47:13 PM UTC+5:30, Yoel Benitez Fonseca > wrote: >> >> and what value are u getting on 'k', the day of month i suppose !? >> >> 2016-11-28 9:5

[web2py] Re: Storing rows

2016-11-28 Thread Dave S
On Monday, November 28, 2016 at 4:00:07 AM UTC-8, Anthony wrote: > > Hard to say without seeing more code. Would virtual fields help? If you're > creating your own Rows object, note that the first argument of the > constructor is the db object, so just pass it in. > > Also, generating an HTML t

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Jim S
Seems to me the code should look like this: form3 = SQLFORM.factory(Field('ddate', 'date', label='Enter a date')) if form3.process().accepted: k = form3.vars.ddate.day() redirect(URL('readings', 'check', args=[k,k,k])) return dict(formd=form3) ...but, I'm not entirely sure what you're

Re: [web2py] Re: How to add an input field in SQLFORM.grid??

2016-11-28 Thread Paul Ellis
What about if I don't use 'callback' but 'href' so it loads the whole page. I still can't get the quantity value to be passed as an arg. On Saturday, 26 November 2016 14:35:33 UTC+1, Anthony wrote: > > On Friday, November 25, 2016 at 11:11:41 PM UTC-5, Paul Ellis wrote: >> >> Hi, >> I am trying t

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Yoel Benitez Fonseca
Instead of: form3 = SQLFORM.factory(Field('ddate','date', label='Enter a date')).process() if form3.accepted: k=form3.vars.ddate.day() redirect(URL('readings', 'check', args=[k,k,k])) Do: form3 = SQLFORM.factory(Field('ddate','date', label='Enter a date')).process() if form3.acce

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Mike Stephenson
I am not getting the day of the month On Monday, November 28, 2016 at 10:47:13 PM UTC+5:30, Yoel Benitez Fonseca wrote: > > and what value are u getting on 'k', the day of month i suppose !? > > 2016-11-28 9:56 GMT-05:00 Mike Stephenson >: > > > form3 = SQLFORM.factory(Field('ddate','date', lab

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Yoel Benitez Fonseca
and what value are u getting on 'k', the day of month i suppose !? 2016-11-28 9:56 GMT-05:00 Mike Stephenson : > form3 = SQLFORM.factory(Field('ddate','date', label='Enter a > date')).process() > if form3.accepted: > k=form3.vars.ddate.day() > redirect(URL('readings', 'check', args

[web2py] Re: Smart-joins helper needs peer review :)

2016-11-28 Thread Marlysson Silva
The great job .. I am just looking in your project awesome.. Now I go studying more framework to help you in your project :D Em domingo, 27 de novembro de 2016 19:01:53 UTC-3, Jurgis Pralgauskis escreveu: > > Hi, > > Web2py is nice for its expression brevity -- but joins still need quite > lo

[web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Mike Stephenson
form3 = SQLFORM.factory(Field('ddate','date', label='Enter a date')).process() if form3.accepted: k=form3.vars.ddate.day() redirect(URL('readings', 'check', args=[k,k,k])) K doesn't read value as expected. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation

Re: [web2py] Re: install plugin via batch procedure

2016-11-28 Thread Manuele Pesenti
Il 28/11/16 13:07, Anthony ha scritto: > .w2p files (including plugin files) are just .tar.gz files, so > ultimately you just need to unzip it over the application folder. To > do that, you can use the gluon.fileutils.w2p_unpack_plugin function > (or just the gluon.fileutils.w2p_unpack function, wh

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
In your query, are you doing a join with the photos table to actually retrieve the photos? If so, only the records with photos will be returned (assuming an inner join). Otherwise, you can do a nested select :

Re: [web2py] Adding user to a group after registration

2016-11-28 Thread Anthony
On Sunday, November 27, 2016 at 3:04:57 PM UTC-5, Joe Lwe wrote: > > Hi Kumar, > am at the wall with the same problem you hard, am not having success > First, please always explain exactly what problem you are having -- what do you expect, and what is happening instead? If you get an error, show

[web2py] Re: install plugin via batch procedure

2016-11-28 Thread Anthony
.w2p files (including plugin files) are just .tar.gz files, so ultimately you just need to unzip it over the application folder. To do that, you can use the gluon.fileutils.w2p_unpack_plugin function (or just the gluon.fileutils.w2p_unpack function, which is called by the former). They are simp

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
I have a table, called 'vehicles', and this has so many fields. In another, table, called 'photos', I have a field, called 'Vehicle', which is reference to my vehicle table .. I'm doing a search form, and I need to filter records from my vehicle table, which have been referenced in the 'photos' ta

[web2py] Re: Storing rows

2016-11-28 Thread Anthony
Hard to say without seeing more code. Would virtual fields help? If you're creating your own Rows object, note that the first argument of the constructor is the db object, so just pass it in. Also, generating an HTML table from a set of records either via the web2py HTML helpers or the template

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Anthony
On Monday, November 28, 2016 at 5:13:30 AM UTC-5, Áureo Dias Neto wrote: > > > Good Morning, With this line of code, do I get the records of the tables > referenced in table A? > No, it wasn't clear what you were looking for. > My question is as follows, I have two tables, A and B, I want to

[web2py] Re: Processing taking a long time in web2py?

2016-11-28 Thread Si
Okay thanks. I've been looking at profiling my application and I'm running an apache webserver. Do you know how I would run this? I don't have a local machine. 1. python web2py.py -F profiler.log -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.co

[web2py] Re: REST especification - Documentation RESTFul services in web2py

2016-11-28 Thread Marlysson Silva
I am studying documentation , I may report or update some things there are .. The place to submit revisions is web2py-book in web2py organization in the github? Em domingo, 27 de novembro de 2016 22:49:31 UTC-3, Massimo Di Pierro escreveu: > > You are right. That documentation is 10 years old

[web2py] Re: 502 Bad Gateway - no tmp/web2py.socket file

2016-11-28 Thread Richard Brown
The only message is still: 2016/11/28 10:17:55 [crit] 674#0: *1 connect() to unix:///tmp/web2py.socket failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.65, server: raspberrypi, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:///tmp/web2py.socket:", host:

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
have some record in the table referenced this record of *B* 2016-11-28 8:12 GMT-02:00 Áureo Dias Neto : > > Good Morning, With this line of code, do I get the records of the tables > referenced in table A? My question is as follows, I have two tables, A and > B, I want to check which records

Re: [web2py] Re: how to make Query, without redundance

2016-11-28 Thread Áureo Dias Neto
Good Morning, With this line of code, do I get the records of the tables referenced in table A? My question is as follows, I have two tables, A and B, I want to check which records in table A, have some record in the table referenced this record of A hug 2016-11-26 11:33 GMT-02:00 Anthony : > Not

[web2py] Docs and SQLTABLE

2016-11-28 Thread Dave S
The first mention of SQLTABLE in the book seems to be in Chapter 6, under Table Constructor, format attribute, without much to show what SQLTABLE is. The definition (signature) of SQLTABLE is under Rendering rows using represent, and the search tool doesn't seem to find that. I'm not sure how

[web2py] install plugin via batch procedure

2016-11-28 Thread Manuele Pesenti
Hi! I'm trying to figure out how to install a web2py plugin without using the admin web interface but a batch procedure running a script or command... any idea? Thank you very mutch Cheers Manuele -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.c

[web2py] Storing rows

2016-11-28 Thread Dave S
I'm wanting to munge the Rows I get back from the DB when I do my query; kind of a custom group-by. This involves adding an integer field and concatenating a string field. So I was wanting to take the first Row, and put it into another object ... dict or Storage or Rows. I was hoping to use t