[web2py] Re: SQlite to Postgres insert problems

2015-11-19 Thread Carla Raquel
Problem solved!Everything is working fine now! quarta-feira, 18 de Novembro de 2015 às 15:35:32 UTC, Carla Raquel escreveu: > > I'm having some troubles importing from csv files while using a Postgres > connection, when a table has one or more references to other tables like so: > >

[web2py] request.args and request.args[-3] == 'view':

2015-11-19 Thread Gael Princivalle
Hello all. With a grid I use a custom single record view. So in my view I have this test: if request.args and request.args[-3] == 'view': for displaying the custom single record view. But when I click on the add record button I have this error: list index out of range Is there a way to use a

[web2py] Re: Small issue in DAL using ``

2015-11-19 Thread Niphlod
created and defined are different things. rephrasing: are you sure that the DAL instance defines the master table before the call to the sub-table definition happens ? On Thursday, November 19, 2015 at 12:12:05 AM UTC+1, Maxwell Morais wrote: > > Thank you so much for the answer! > > Yes, I'm

[web2py] creating a secure rest service

2015-11-19 Thread Jason Solack
Hello, I'm wondering if anyone is aware of a guide on creating a secure REST service with web2py. I'd like to get help with creating authentication tokens and handshaking and then creating a temporary key allowing people to access the service for a set period of time. Thank you for you help

[web2py] Re: creating a secure rest service

2015-11-19 Thread Dave S
On Thursday, November 19, 2015 at 4:25:07 PM UTC-8, Jason Solack wrote: > > Hello, > > I'm wondering if anyone is aware of a guide on creating a secure REST > service with web2py. I'd like to get help with creating authentication > tokens and handshaking and then creating a temporary key

Re: [web2py] Re: exporting to csv

2015-11-19 Thread lucas
yes, thank you, that works great. you know i tried to see all of that in the source code api, but i couldn't find the source code api anymore. lucas -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread Mark Graves
I just tried to reproduce your error and could not. Judging from the error, are you sure you are passing in the string 'auth.create_user_groups' and not auth.create_user_groups as a variable? On Thu, Nov 19, 2015 at 9:32 PM, 黄祥 wrote: > tested it. return an

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread 黄祥
tested it. return an error if i put the value int = 1 as true in appconfig.ini e.g. privates/appconfig.ini [auth] create_user_groups = 0 ; return an error traceback when value = 1, when value = 0, no error occured, works as expected models/db.py auth.settings.create_user_groups =

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread Mark Graves
Can you reproduce this error in a fresh welcome app? Then you can send just the one line? Is it solely: ; auth [auth] create_user_groups = 1 VS ; auth [auth] create_user_groups = 0 ? On Thu, Nov 19, 2015 at 10:44 PM, 黄祥 wrote: > pardon, i just tried, what

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread Mark Graves
It appears that auth.settings.create_user_groups takes either False or the string that formats the user group creation message. So you'll need to provide a string format representation ie '%(id)s' as is shown in the error. However that won't convert to a boolean, so your cast function will fail.

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread 黄祥
pardon, i just tried, what is discussed in this thread on my configuration, parsing as string .'auth.create_user_groups' not auth.create_user_groups as a variable e.g. models/db.py auth.settings.create_user_groups = False i want to change the configuration into privates/appconfig.ini with :

Re: [web2py] Re: Appconfig cast boolean

2015-11-19 Thread Mark Graves
Also: auth.settings.create_user_groups = myconf.take('auth.create_user_groups', cast=lambda value: bool(int(value))) On Thu, Nov 19, 2015 at 10:53 PM, Mark Graves wrote: > Can you reproduce this error in a fresh welcome app? > > Then you can send just the one line? > >

[web2py] web2py

2015-11-19 Thread MOHANA LAHARI Tanguturi
i am using this syntax results = json.load(urllib.urlopen("http://www.pricetree.com/dev/api.ashx?pricetreeId=11072=7770AD31-382F-4D32-8C36-3743C0271699;)) it is showing this error HTTP Error 403: Forbidden what should i do pls reply to this qustion -- Resources: - http://web2py.com

[web2py] Re: Upload file using the LOAD (....., ajax = True)

2015-11-19 Thread Bart
Hi Anthony, This solution you mention is, with some minor changes, still working in the current version. I've managed to get the change working in the 2.12.3 version of web2py.js: Change function trap_form to: trap_form: function(action, target) { /* traps any LOADed form */

[web2py] How to use update query with joins?

2015-11-19 Thread mfarees . knysys
I need some help with a DAL query. I'm trying to update records, but my query contains joins. *tournament Table* | id | start | end | *match Table* | id | tournamentID | home_team | away_team | start | end | db( ((db.tournament.start >= '2015-01-01 00:00:00') & (db.tournament.end <=

Re: [web2py] Production - making redirections on default index with parameters (maybe with nginx)

2015-11-19 Thread Sam Heather
Thanks for the reply Kiran - I have gone through that section of the book a couple of times and can't find an answer to what I want. I should clarify: 'myc' is a generic token - a URL argument - I should have written it as or . The full path of the application is /default/company/myc, where

[web2py] Re: Opportunities for deadlock in scheduler.py send_heartbeat?

2015-11-19 Thread Andy Southgate
Thanks for there reply. I'm using 15 workers with a one second heartbeat. I don't think this is fundamentally a load problem though - it looks like a case of two things taking the same locks in a different order. Maybe the situation mentioned here

[web2py] How to add an hour to datetime field

2015-11-19 Thread mfarees . knysys
I have a table that I have created (in models) using db.define_table('myTable', Field('start', type='datetime', requires=NE) ) I have some records in this table, in this format: '2015-12-31 00:00:00' (this is on id = 1) I want to run a query that will add one

[web2py] Re: Web2py + Google Cloud Endpoints: There is a way to make them work together ?

2015-11-19 Thread Victor
Hello, Carlos. Did you manage to make this working? On Wednesday, October 15, 2014 at 4:51:43 AM UTC+2, Cláudio Bastos wrote: > > Hi, > > i'm struggling to make Web2py and Google Cloud Endpoints work together. > > When I change app.yaml to include : > > > - url: /_ah/spi/.* > script:

[web2py] cx_oracle web2Py on windows

2015-11-19 Thread rochdi hassine
I tried to connect web2py to my Oracle database. I have deployed web2py on a windows environment where python was already installed with cx_oracle. But web2py haven't run with Oracle cause it can't see the driver cx_oracle that is installed in Python directory. I tried to redeploy cx_oracle to

[web2py] How to control the access with auth_group?

2015-11-19 Thread Clément Lauprêtre
Hello, I developed an app accessible by different users. There is 4 groups of users who can access to different views. I would like to know how to allow the access to some views for only one group. Thanks Clément. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Compile .less files?

2015-11-19 Thread Thee Cherry
Hi, I try to import (compile) .less files in web2py. I did find in the web2py book that you can import less files with response.files Did try to import a less file with that in the layout.html {{response.files.append(URL('static','less/style.less'))}} But in the source code from the finish

[web2py] Re: Fix input error

2015-11-19 Thread Massimo Di Pierro
The problem is probably in the layout.html you are using. It may be declaring an encoding other than utf8. On Monday, 16 November 2015 18:46:58 UTC-6, Patrik Skřivánek wrote: > > Hello, > > I have in my controller simple input form: > > form=FORM('Search user: ', INPUT(_name='search'),

[web2py] Re: creating a secure rest service

2015-11-19 Thread Massimo Di Pierro
which reminds me... I will include it in the next web2py version. On Thursday, 19 November 2015 19:08:46 UTC-6, Dave S wrote: > > > > On Thursday, November 19, 2015 at 4:25:07 PM UTC-8, Jason Solack wrote: >> >> Hello, >> >> I'm wondering if anyone is aware of a guide on creating a secure REST

[web2py] Re: How to control the access with auth_group?

2015-11-19 Thread 黄祥
i think you can use conditional check auth.has_membership, either put it on models/menu.py, controllers or even in views e.g. if auth.has_membership(role = 'Admin'): best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: request.args and request.args[-3] == 'view':

2015-11-19 Thread Anthony
if len(request.args) >= 3 and request.args[-3] == 'view': or: if request.args(-3) == 'view': request.args(index) is the same as request.args[index], except the former returns None rather than raising an exception if the index is out of range. Finally, you could just do: if 'view' in

Re: [web2py] Re: web2py and python3

2015-11-19 Thread Alessio Varalta
I think that for the programmer is not so important the version..always if the last is not too old..Python 2.7 is not too old but the problem that i see is that there is a good guide and good forum..web2py have many good features, but the real problem that I find( I am a web2py developer from 5