[web2py] About execute sql statement

2015-10-26 Thread DucVa
Hi all, I define a table as below: db.define_table('partner', Field('name') ) In controller, I use execute to get data: sql = 'select name from partner' rows = db.execute(sql) In my laptop, type of rows is LIST, but in other computer in my company, type of rows is ROWS. So, when i print data,

[web2py] Re: cannot disable automatic login after registration

2015-10-26 Thread Pierre
hi stifan, add this to db.py : auth.settings.extra_fields['auth_user']=[Field('geolat','float'), Field('geolng','float')] db.auth_user._manual_entry = False if not db.auth_user._manual_entry: db.auth_user.geolat.readable = False db.auth_user.geol

[web2py] Re: uwsgi/nginx encode error

2015-10-26 Thread Niphlod
I saw the issue you posted but frankly I can't reproduce. https://github.com/web2py/web2py/issues/1089 Can you please pack a minimal app AND the "client" app that pushes the content web2py is unable to parse ? (even a curl line would suffice) Thanks > > -- Resources: - http://web2py.com - ht

[web2py] Re: SQLFORM.grid: trigger edit when clicking anywhere on the row itself

2015-10-26 Thread Niphlod
the edit link isn't that hard to rebuild ... /edit/tablename/record_id On Saturday, October 24, 2015 at 1:02:31 PM UTC+2, Julian Sanchez wrote: > > Is there an easy way to trigger the same URL you get when pressing the > built-in 'edit' button of the SQLFORM.grid without having to show tha

[web2py] Re: Clean Bootstrap layout

2015-10-26 Thread Niphlod
wait. all I can read from this post is "can I have a clean bs3 layout *without web2py cruft* but *with web2py cruft* ?" What's the cruft and what's the bare essential ? On Saturday, October 24, 2015 at 8:27:17 AM UTC+2, pbreit wrote: > > I'm not sure what exactly I need in my template for Web2py

[web2py] Re: Should this work in Web2py

2015-10-26 Thread Niphlod
an update operation NEEDS an update() call. given the records you want to update are defined by a condition, namely db.table.column_1 == somevalue and the update on column_2 resulting in all those records equal to "somevalue_2", you need to write db(db.table.column_1 == somevalue).update(colum

[web2py] Re: string indices must be integers, not str

2015-10-26 Thread Niphlod
imho your "x" is a string rather than a dict. you need to parse that string to a dict if you want your code to run. On Monday, October 26, 2015 at 5:31:53 AM UTC+1, Alex Glaros wrote: > > feel dumb asking about this subject again but what is correct way to get > the individual value? > > here is

[web2py] Re: Really can't use database reserved words?

2015-10-26 Thread Niphlod
BTW: Anthony's answer is the right one because with that you get the best of both worlds. Mind that you can also disable completely reserved words (check_reserved argument on the DAL connection) and be prepared to fireworks when you'll choose something your backend can't distinguish. Being a sa

[web2py] Re: IS_DATE() and timezones

2015-10-26 Thread Julian Sanchez
Thanks for the heads-up!! Switching over to datetime as we speak (and working pretty good!!!) Best, Julian On Sunday, October 25, 2015 at 6:29:24 PM UTC-5, Anthony wrote: > > FYI, we're going to remove the timezone option from IS_DATE (which doesn't > work anyway), so you're better off using a

[web2py] opening different grids with the same controller in a multi-tabs form(seeking for confirmation)

2015-10-26 Thread Carlos Kitu
Hi, I have a sqlform with four tabs. There is a main form and 4 additional tabs. In each tab there is one grid with a related table to the one in the main form (1 to many relationship), and they are loaded gracefully using the LOAD function and ajax. In my first version, I used a separate funct

[web2py] Re: opening different grids with the same controller in a multi-tabs form(seeking for confirmation)

2015-10-26 Thread Carlos Kitu
By the way, I just noticed pushing the "Back" button in the main form (not loaded with ajax, just a normal grid created by a controller), that it is also pointing to the url of the last loaded grid. Probable another side effect of the same problem. Best regards. El lunes, 26 de octubre de 2015

[web2py] Support for GQL DISTINCT

2015-10-26 Thread Carl Hunter Roach
Google slipped in support for DISTINCT in its GQL SELECT in 2013. Are there any plans to add this to the DAL? Ref: https://cloud.google.com/datastore/docs/apis/gql/gql_reference -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

Re: [web2py] Re: opening different grids with the same controller in a multi-tabs form(seeking for confirmation)

2015-10-26 Thread Vinicius Assef
You can try filling the `formname` argument of SQLFORM.grid(). -- Vinicius Assef On 26 October 2015 at 08:45, Carlos Kitu wrote: > By the way, I just noticed pushing the "Back" button in the main form (not > loaded with ajax, just a normal grid created by a controller), that it is > also p

Re: [web2py] Re: opening different grids with the same controller in a multi-tabs form(seeking for confirmation)

2015-10-26 Thread Carlos Kitu
Vinicius, thank you so much for your help. It worked fine. Best regards. El lunes, 26 de octubre de 2015, 12:11:21 (UTC+1), Vinicius Assef escribió: > > You can try filling the `formname` argument of SQLFORM.grid(). > > > > > -- > Vinicius Assef > > > > On 26 October 2015 at 08:45, Carlos Kitu >

[web2py] Re: Support for GQL DISTINCT

2015-10-26 Thread Carl Hunter Roach
Here's my Web2py-driven Python: db = current.db rows = db().select(db.person.name, distinct=db.person.name) for row in rows: logging.info('name: %s' % row.name) This logs all rows from person, listing many duplicate name values. The equivalent GQL I've tried is: rows = g

Re: [web2py] Fwd: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP

2015-10-26 Thread Ron Chatterjee
Is there a web2py example using this? On Sunday, October 25, 2015 at 2:16:24 PM UTC-4, Massimo Di Pierro wrote: > > Docs say: This is a server for SMTP and related protocols, similar in > utility to the standard library’s smtpd.py module, but rewritten to be > based on asyncio for Python 3. > >

[web2py] Re: Support for GQL DISTINCT

2015-10-26 Thread Anthony
The Google Datastore adapter doesn't use GQL but instead uses the Python NDB datastore API. I think you can add the distinct=True argument to the .query() method (at least for projection queries), so you might try subclassing pydal.adapters.google_adapters.GoogleDatastoreAdapter and customize i

Re: [web2py] Re: Appconfig - what's the best way to handle missing values

2015-10-26 Thread Richard Vézina
I think what Donald is talking about arrive when migrate or pool_size are missing... In line if in the connection string can do the tricks... But it more hacky... I would make a default AppConfig file and an user or application AppConfig file where application AppConfig override the default one of

Re: [web2py] Re: Appconfig - what's the best way to handle missing values

2015-10-26 Thread Richard Vézina
I opened this issue : https://github.com/web2py/web2py/issues/1093 On Mon, Oct 26, 2015 at 9:59 AM, Richard Vézina wrote: > I think what Donald is talking about arrive when migrate or pool_size are > missing... In line if in the connection string can do the tricks... But it > more hacky... I wou

Re: [web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]

2015-10-26 Thread Ron Chatterjee
So, I took a stab at Ivica's post. Created the db in my model file as: db.define_table("contact_form", Field("your_name", "string"), Field("your_email", requires=IS_EMPTY_OR(IS_EMAIL(error_message='invalid email'))), Field("your_phone_number", "stri

Re: [web2py] Fwd: aiosmtpd 1.0a1 - asyncio-based implementations of SMTP/LMTP

2015-10-26 Thread Niphlod
@ron: these are questions that rise kinda for nothing. first, it's a project for python 3.x , leveraging asyncio, that is not there in python 2.x (which web2py leverages). second, it's a SMTP server: running it inside a webserver (web2py) is silly. On Monday, October 26, 2015 at 2:09:07 PM UTC+1

[web2py] web2py crashes when fetching url from the same server

2015-10-26 Thread sa
2.12.3-stable+timestamp.2015.08.19.00.18.03 (Running on Apache/2.4.7 (Ubuntu), Python 2.7.6) --- from gluon.tools import fetch def index(): page = fetch('http://my_url') return page

[web2py] Is it safe to use Virtual fields ?

2015-10-26 Thread Pierre
Hi everyone, I am asking this because new style virtual field is marked as experimental in the web2py book. what happens if an application using virtual fields is deployed and the command syntax changes ? will the new syntax/api be backward compatible ? ps: I know virtual fields wont explode

[web2py] Re: About execute sql statement

2015-10-26 Thread Anthony
.executesql() doesn't return a Rows object unless you pass in fields. Are you showing the *exact* code? Did you copy the exact application from one machine and move it to another, or are there any differences at all? Anthony On Monday, October 26, 2015 at 3:29:40 AM UTC-4, DucVa wrote: > > Hi a

[web2py] Re: Is it safe to use Virtual fields ?

2015-10-26 Thread Anthony
We should probably remove the "experimental" label -- the "new" style is now several years old. I think it's safe. Anthony On Monday, October 26, 2015 at 12:29:16 PM UTC-4, Pierre wrote: > > Hi everyone, > > I am asking this because new style virtual field is marked as experimental > in the web

[web2py] Re: web2py crashes when fetching url from the same server

2015-10-26 Thread Niphlod
posting the exception may help. On Monday, October 26, 2015 at 5:10:31 PM UTC+1, sa wrote: > > 2.12.3-stable+timestamp.2015.08.19.00.18.03 > (Running on Apache/2.4.7 (Ubuntu), Python 2.7.6) > > --- > > from gluon.tools imp

[web2py] Re: Why is appadmin redirecting to URL('default', 'index') from within web2py IDE?

2015-10-26 Thread weheh
This continues to be an issue. http://127.0.0.1:8000/appadmin redirects to URL('default', 'index'). Any thoughts? On Friday, October 9, 2015 at 3:49:16 PM UTC-6, Leonel Câmara wrote: > > Deleting welcome shouldn't cause problems for your existing apps, as it > should use the appadmin in myapp's

[web2py] Re: web2py crashes when fetching url from the same server

2015-10-26 Thread Leonel Câmara
You seem to be going into infinite recursion because index is fetching index which fetches index which fetches index ad infinitum. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/

[web2py] Re: Is it safe to use Virtual fields ?

2015-10-26 Thread Pierre
fantastic !!! nothing is better than web2py Le lundi 26 octobre 2015 17:33:20 UTC+1, Anthony a écrit : > > We should probably remove the "experimental" label -- the "new" style is > now several years old. I think it's safe. > > Anthony > > On Monday, October 26, 2015 at 12:29:16 PM UTC-4, Pierr

Re: [web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]

2015-10-26 Thread Ron Chatterjee
It turns out I needed to make my gmail account less secured in order for the email to pass through. And as expected, this wasn't a web2py issue. This was leonel's solution. Thank you Leonel! P.S.: https://www.google.com/settings/security/lesssecureapps On Monday, October 26, 2015 at 10:35:43

[web2py] Re: New feature in trunk. bulk_register/invite

2015-10-26 Thread James Burke
Ok I've done some testing and found a couple of typos, including, tools.py - line 3283: if not self.setting.bulk_register_enabled: should be if not self.settings.bulk_register_enabled: This results in an exception preventing the feature from working. I tried submitting a pull request bu

[web2py] Re: CMS WEB2PY

2015-10-26 Thread James Burke
I created a CMS a few years ago now in web2py... It is fairly basic compared to Carlos one. I have a test website for a client on GAE http://badevday-test.appspot.com/ to access the backend http://badevday-test.appspot.com/admin login: user-gr...@web2py.com password: passw0rd It doesn't have

Re: [web2py] Re: Resource webservice built on web2py for web2py comunity [BETA]

2015-10-26 Thread Ivica Kralj
I've used gmail app password on one of my website (gmail two step auth is enabled) and I haven't experienced any issues. I guess... it could be insecure if somebody can access your web2py admin page (admin should be disabled in anyway) or somebody cracks your hosting account login (e.g. pythonan

[web2py] Re: Why is appadmin redirecting to URL('default', 'index') from within web2py IDE?

2015-10-26 Thread Dave S
On Monday, October 26, 2015 at 9:38:41 AM UTC-7, weheh wrote: > > This continues to be an issue. http://127.0.0.1:8000/appadmin redirects > to URL('default', 'index'). Any thoughts? > What's in your httpserver.log, or the equivalent for your engine? Do you have an /applications//controllers/ap

[web2py] Re: Why is appadmin redirecting to URL('default', 'index') from within web2py IDE?

2015-10-26 Thread Leonel Câmara
what do you have in your routes.py? -- 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 message because you are subscribed to the Google Gro

[web2py] Report a row of a table with attachment

2015-10-26 Thread Alessio Varalta
Hi I have a table with upload field and i will report a row of this table in view. I try to create a form in readonly mode and print in the view but I see only the string file..How i can report the row in the view with the file that the user can download and with the image rapresentation of the

[web2py] Re: Report a row of a table with attachment

2015-10-26 Thread Alessio Varalta
Can i create a sqlform grid with one row and open directly in view mode? On Tuesday, 27 October 2015 00:48:07 UTC+1, Alessio Varalta wrote: > > Hi I have a table with upload field and i will report a row of this table > in view. I try to create a form in readonly mode and print in the view but >

[web2py] Re: Oracle drivers.

2015-10-26 Thread Michael Messmer
Ok That was wrong. mod_wsgi was 3.4 On Thursday, October 22, 2015 at 3:46:42 PM UTC-7, Michael M wrote: > > Is it Possible that the DAL is talking Python 3.4 when my driver is Python > 2.7. So when I call it in Web2py from CLI it works but when the framework > is running its trying to call 3

[web2py] Re: Report a row of a table with attachment

2015-10-26 Thread Dave S
On Monday, October 26, 2015 at 4:48:07 PM UTC-7, Alessio Varalta wrote: > > Hi I have a table with upload field and i will report a row of this table > in view. I try to create a form in readonly mode and print in the view but > I see only the string file..How i can report the row in the view w

[web2py] parse_as_rest - filter GET request with parameters rather than patterns

2015-10-26 Thread Mamisoa Andriantafika
Hi, Is it possible to GET an answer with a setup restfull service with parse_as_rest with: /rest/table_name?id=1 that is equivalent to the working: /rest/table_name/id/1 ? Morever with more parameters: /rest/table_name?id=1&name=Toto Mike -- Resources: - http://web2py.com - http://

[web2py] Re: Oracle drivers.

2015-10-26 Thread Michael Messmer
So i noticed something. I was in root when when I was seeing cx_Oracle: # python web2py.py web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2015 Version 2.12.3-stable+timestamp.2015.08.19.00.18.03 Database drivers available: sqlite3, imaplib, cx_Oracle, pymysql, pg8000 When I