Re: [web2py] Re: {{=XML(data)}} for javascript variable issue

2014-06-13 Thread Manuele Pesenti
Il 12/06/14 23:26, LoveWeb2py ha scritto: > So I currently have it like this: > > function init(){ > var json = '{{=XML(json_data_from_controller)}}'; what about to use this code instead? function init() { window.json = {{=XML(json_data_from_controller)}}; }; and then you can find your v

[web2py] Re: Apache-wep2py error when upgrading to Debian Wheezy

2014-06-13 Thread Alfonso Pastor Sierra
Hello, editing /var/web2py/subwsgihandler.py and commenting two lines: def start_response(self, status, headers, info=None): # rewrite redirect URLs, so external referencens have the SCRIPT_NAME prefix if not status.startswith('3'): return self._start_response(status

[web2py] Re: multiple models in a plugin component

2014-06-13 Thread Louis Amon
Ok here's my best solution so far: I keep the whole plugin contained according to the rules defined in the documentation and, in order to have my my models visible to the global namespace, I expose the plugin's model folder using this little line : response.models_to_run.append('plugin_name')

[web2py] Bad gateway with components and cgi in apache

2014-06-13 Thread Carlos Cesar Caballero Díaz
Hi, I am running web2py with apache and cgi using this approach on my .htaccess: RewriteEngine on RewriteBase /home/devikhxr/public_lab-wp2 RewriteRule ^(admin|myapp)(/.*)?$ /cgi-bin/cgihandler.py and cgihandler.py: #!/usr/bin/env python # -*- coding: utf-8 -*- import os impor

[web2py] Re: multiple models in a plugin component

2014-06-13 Thread Anthony
Yes, by default, response.models_to_run is set so web2py runs all models in the top level /models folder, and then any models in subfolders whose names match the request controller and function (so model files in a folder named after the plugin would only be run if the plugin controller is calle

[web2py] How to support DB migrations on Heroku?

2014-06-13 Thread Rene Dohmen
Hi Web2py Users, I deployed an app with postgres on Heroku following the info in: https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-heroku.sh https://github.com/web2py/web2py/blob/master/gluon/contrib/heroku.py I already had a working postgres database from a previous deployment

[web2py] Is there a method to force a user to change their password?

2014-06-13 Thread Michael Beller
Also, what is the "password reset key" used for? I see in some posts information about "registration key" but not "registration identifier" - what is the identifier used for? if registration_key=='' : user can login if registration_key=='blocked' : user account is blocked if registration_key

[web2py] Download inside component

2014-06-13 Thread LaDarrius Stewart
Currently have a modal being filled by the following code links=[lambda row: BUTTON('Apply Payment', _onclick="web2py_component('%s', 'modalinfo');" % \ URL('default', 'applypayment2.load', args=row.Inv_Header.id),

[web2py] Re: Download inside component

2014-06-13 Thread Anthony
Maybe have a look at this: http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ On Friday, June 13, 2014 11:08:22 AM UTC-4, LaDarrius Stewart wrote: > > Currently have a modal being filled by the following code > links=[lambda row: BUTTON

Re: [web2py] Re: lambda cannot contain assignment

2014-06-13 Thread Fabiano Almeida
Hi Anthony, It worked! Now I understand better how to use callback. Thank you very much!! Fabiano. 2014-06-12 16:13 GMT-03:00 Anthony : > lambda qset, f: > f.update(cadastro=request.now if f['status'] in ['Edição', 'Enviado'] > else None) -- Resources: - http://web2py.com - http://web2py

[web2py] from a friend ... real python courses discount

2014-06-13 Thread Massimo Di Pierro
FORWARDED: Get 50% off Real Python! I highly endorse this course for teaching the Python syntax, web fundamentals (such as scraping and REST), database programming, and web development in a practical, interesting manner. Download: http://bit.ly/1qf66vS Code: 50OFF4W2P With regards to web2

[web2py] successful deployment of X509?

2014-06-13 Thread LoveWeb2py
There doesn't seem to be much documentation on the X509Auth that Web2py provides. I've tried to use it but get an error saying no valid credentials when I try to follow the example from the book. Has anyone successfully implementated X509Auth with web2py? -- Resources: - http://web2py.com -

[web2py] import module once for all

2014-06-13 Thread chuan137
Dear web2pyers, Some functions are packed into a class, which I put it under modules/myclass.py. To reuse the functions, say in the controllers, I usually import the module, create a new instance of myclass inside the controller function. I wonder is it possible to import the module when the

[web2py] change requirements of new password

2014-06-13 Thread Raymond Wong
Hello all, I would like to ask how can I make a requirement that whenever a user creates a new password, it cannot be the same as any of his previous ten passwords? It would be great if anyone can let me know which file should I edit or if I should write a function to do it in the controller?

[web2py] web2py.com is down

2014-06-13 Thread Ide
I could get onto www.web2py.com yesterday or today, is this the right place to report this? -- 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

[web2py] Web2py with postgresql and DB triggers

2014-06-13 Thread Chris Farrar
Hi, I'm struggling with a strange issue. I have a web2py application with a simple data model. I have a table called "reorder". The user is able to interact with "reorder" using a SQLFORM.grid. I have implemented the oncreate call back. My oncreate callback gets the id of the newly insert

[web2py] how to make web2py routing all controllers and functions??

2014-06-13 Thread Mohammed Suleiman
i want something like this using web2py routing : - domain.com/App/controller/view/args?profile Id=XX - domain.com/App/profile Id/controller/view/args i try this code : routes_in = (

[web2py] Retaining session information on form submits/page refreshs

2014-06-13 Thread Latif Masud
Hello Group, I have a string that acts as an events log that I print out to the webpage. The string is defined as a blank global string before the function is defined, and as the code is executed, more and more information is concatenated to the string. The problem is that every time a form i

[web2py] Javascript variable not showing after passing through function

2014-06-13 Thread Jon
Hello, I'm using infoviz and web2py and trying to create the Force Directed graph. here is my code: controller: def visual(): import json import os infile = open(os.path.join(request.folder, 'private', 'jsondata.t

[web2py] IS_IN_SET and IS_IN_DB, but my focus is on SQLFORM.widgets.multiple.widget - with multiple=True

2014-06-13 Thread Martin Bothma
Morning. Does anyone have an EXAMPLE/S of the use of the above, with multiple=True. I am relatively new at this - although am getting there - but am stuck on this one. As indicated I'm looking for examples please - a few if possible. I am using db.auth with extended variables, with list:ref

[web2py] Re: how to make web2py routing all controllers and functions??

2014-06-13 Thread Massimo Di Pierro
It can be done but you should be aware that this conflits with appadmin and with static files. Assuming a profile id can be "appadmin" or "static" then you want something like this (I think, not tested): routes_in = ( ('/appname/$id', '/appname/default/index/$id'), ('/appname/$id/$c/',

[web2py] Re: ERROR when MYSQL try to CAST() to LONGTEXT

2014-06-13 Thread Massimo Di Pierro
I have a possible fix in trunk. Can you help test it? On Wednesday, 11 June 2014 23:06:44 UTC-5, André Kablu wrote: > > > I have a mysql database and created a LIST:INTEGER field > > It is created in MYSQL as LONGTEXT type of data > > > In one of my queries I have received an error: > > *WEB2PY QU

[web2py] Re: Web2py with postgresql and DB triggers

2014-06-13 Thread Massimo Di Pierro
What does "#now do something with newreorderrow" do? On Thursday, 12 June 2014 14:12:45 UTC-5, Chris Farrar wrote: > > Hi, > > I'm struggling with a strange issue. > > I have a web2py application with a simple data model. I have a table > called "reorder". The user is able to interact with "re

[web2py] Re: change requirements of new password

2014-06-13 Thread Massimo Di Pierro
You need a file that stores his previous 10 HAHSED passwords. You also needs a validator that checks the new passwords vs the values of that field. You may need to build your own login controller. On Thursday, 12 June 2014 14:46:44 UTC-5, Raymond Wong wrote: > > Hello all, > > I would like to

[web2py] Re: Apache-wep2py error when upgrading to Debian Wheezy

2014-06-13 Thread Massimo Di Pierro
What are you trying to do? This is not web2py code. On Friday, 13 June 2014 05:59:53 UTC-5, Alfonso Pastor Sierra wrote: > > > Hello, editing /var/web2py/subwsgihandler.py and commenting two lines: > > def start_response(self, status, headers, info=None): > # rewrite redirect URLs, so ext

[web2py] Re: import module once for all

2014-06-13 Thread Massimo Di Pierro
Even if you say import myclass in the controller and this statement is executed at every request, the module is imported and it runs only once. If you put initialization code in the module it will run only the first time. You can do: # in myclass.py initialized = False # end # in controller i

[web2py] Re: Is there a method to force a user to change their password?

2014-06-13 Thread Massimo Di Pierro
Good question. registration_id is used by web2py with federated authentication to map a local user to the federated id. For example the id could be a google id or an openid of a cas is. registration_key is a random key assigned to the user when they register if the registration requires verif

[web2py] Re: Apache-wep2py error when upgrading to Debian Wheezy

2014-06-13 Thread Alfonso Pastor Sierra
The code is from: http://www.web2pyslices.com/slice/show/1383/make-web2py-sub-url-mountable-with-apachemod-wsgi I want to access a web2py application with the URL: http://server/controlies using apache and mod-wsgi. El viernes, 13 de junio de 2014 18:58:02 UTC+2, Massimo Di Pierro escribió:

[web2py] Re: ERROR when MYSQL try to CAST() to LONGTEXT

2014-06-13 Thread André Kablu
Sure. Did you pushed it? I cannot find it there... Many thanks! On Friday, June 13, 2014 1:45:44 PM UTC-3, Massimo Di Pierro wrote: > > I have a possible fix in trunk. Can you help test it? > > On Wednesday, 11 June 2014 23:06:44 UTC-5, André Kablu wrote: >> >> >> I have a mysql database and crea

[web2py] Re: Is there a method to force a user to change their password?

2014-06-13 Thread Michael Beller
Thanks Massimo, Is there a method to force a user to change their password, e.g., after uploading a list of users? On Friday, June 13, 2014 1:07:32 PM UTC-4, Massimo Di Pierro wrote: > > Good question. > > registration_id is used by web2py with federated authentication to map a > local user to

[web2py] Re: Is there a web2py plugin which lays out divs in a neat grid?

2014-06-13 Thread Derek
Well, if you run into issues with masonry let me know, I'll try to help you out. On Thursday, June 12, 2014 6:40:41 PM UTC-7, Spokes wrote: > > Thanks, Derek. I'd like to not animate at all, and I've adjusted > freewall's settings accordingly, to no avail. The animation effect only > happens un

[web2py] Re: Auto update db records behaviour per input field on release (AJAX)

2014-06-13 Thread Derek
Try 'parsely' http://parsleyjs.org/doc/examples/simple.html and prompt on page close to save first. On Wednesday, June 11, 2014 7:43:41 PM UTC-7, Francisco G. T. Ribeiro wrote: > > hi all, > I'm working on an app that uses forms that can be quite long and its users > often interrupt their sessi

[web2py] Do not mask password field

2014-06-13 Thread Kenneth
Hello, I'm pretty sure this is a stupid question but I just can't get it working. I have created a form to edit a user in auth_user, so one field is password. Is it possible in controller disable the masking of the values in the password, when entering a new password? Kenneth -- Resource

Re: [web2py] Do not mask password field

2014-06-13 Thread Robby O'Connor
You could do it via js likely...but better question is why do you want this? --Rob Sent from my phone...excuse any typos please! On Jun 13, 2014 5:08 PM, "Kenneth" wrote: > Hello, > > I'm pretty sure this is a stupid question but I just can't get it working. > > I have created a form to edit a u

[web2py] Re: Is there a web2py plugin which lays out divs in a neat grid?

2014-06-13 Thread Spokes
Just tried Masonry again, and it works like a charm! I guess whatever fixes I've applied since I first tried it have made it easier for the plugin to do its arrangement function. Thanks again! On Friday, June 13, 2014 3:01:17 PM UTC-5, Derek wrote: > > Well, if you run into issues with masonry l

Re: [web2py] Do not mask password field

2014-06-13 Thread Dave S
On Friday, June 13, 2014 2:09:59 PM UTC-7, Robert O'Connor wrote: > > You could do it via js likely...but better question is why do you want > this? > > --Rob > Sent from my phone...excuse any typos please! > Well, that there points to one reason ;-) (It's not unusual for mobile apps to brief

[web2py] Re: Auto update db records behaviour per input field on release (AJAX)

2014-06-13 Thread Francisco G. T. Ribeiro
Thank you for stepping up to reply but 'parsely' looks more like a library for client-side form validation which is already not really the major problem I am trying to address. My goal is to have a mechanism that stores (with persistence) information provided by the user as soon as possible onc

Re: [web2py] Do not mask password field

2014-06-13 Thread Marin Pranjić
Can you try if this works? db.auth_user.password.type = 'string' On Sat, Jun 14, 2014 at 12:26 AM, Dave S wrote: > > > On Friday, June 13, 2014 2:09:59 PM UTC-7, Robert O'Connor wrote: >> >> You could do it via js likely...but better question is why do you want >> this? >> >> --Rob >> Sent fro

[web2py] Re: Download inside component

2014-06-13 Thread Limedrop
I use that jquery plugin and it is very good. Note that you need to set cookies within the download function, something like this... response.cookies['fileDownload'] = 'true' response.cookies['fileDownload']['path'] = "/" On Saturday, June 14, 2014 3:40:01 AM UTC+12, Anthony wrote: >

Re: [web2py] Do not mask password field

2014-06-13 Thread Kenneth
Thank you Marin, that did it. Rob, the form is for creating new users and client complains about not seeing the password. Kenneth Den lördagen den 14:e juni 2014 kl. 01:31:15 UTC+3 skrev Marin Pranjić: > > Can you try if this works? > > db.auth_user.password.type = 'string' > > > On Sat, J

[web2py] orderby / case

2014-06-13 Thread Kenneth
Hi, I have a table that contains 5 items. Usually I order them by product name. Now I'd like to order them so a specific ID is first and then the rest. As everything else is ready I'm looking into making the SQL query do the ordering. I found a posting ( https://groups.google.com/forum/?from