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 variable in the window name space in your script.

M.
>
> but I'm still getting undefined
>
> On Thursday, June 12, 2014 2:42:31 PM UTC-4, Andrew W wrote:
>
> Yes.  Add a 

[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, headers, info)
# status: 3xx (redirect)
_headers = []
for key, value in headers:
   # if key == 'Set-Cookie':
# don't modify the cookie, it already has a modified 
location
#return self._start_response(status, headers, info)
# relative URLs start with '/', absolute URLs start with 'http'
if key == 'Location' and value.startswith('/'):
value = self.script_name + value
_headers.append((key, value))
return self._start_response(status, _headers, info)

it runs without errors.

Why?

El domingo, 1 de junio de 2014 13:06:18 UTC+2, Alfonso Pastor Sierra 
escribió:
>
> Hello, 
>
> I have a web2py application with apache:
>
> cat /etc/apache2/conf.d/controlies-apache 
>
> WSGIScriptAlias /controlies /var/web2py/subwsgihandler.py
>
> WSGIDaemonProcess web2py user=www-data group=www-data \
>   home=/var processes=5 \
>   maximum-requests=1 \
>   threads=1
>
> 
> Order deny,allow
> Allow from all
> WSGIProcessGroup web2py
> 
>
> With Debian Squeeze when I run:
>
> # wget http://ldap/controlies
>
> The result is:
>  
>
> --2014-05-31 21:10:19--  http://ldap/controlies
> Resolviendo ldap... 172.23.231.3
> Connecting to ldap|172.23.231.3|:80... conectado.
> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
> *Localización: 
> /controlies/init/default/user/login?_next=/controlies/init/default/index 
> [siguiendo]*
> *--2014-05-31 21:10:19-- 
>  
> http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index
>  
> *
> *Reusing existing connection to ldap:80.*
> *Petición HTTP enviada, esperando respuesta... 200 OK*
> Longitud: 12488 (12K) [text/html]
> Saving to: `controlies'
>
> 100%[=>] 12.488  --.-K/s   in 0s  
>
> 2014-05-31 21:10:19 (803 MB/s) - `controlies' saved [12488/12488]
>
>
> But, after upgrading the server to Debian Wheezy when I run:
>
>
> #wget http://ldap/controlies
>
>
> The result is:
>  
>
> --2014-05-31 21:12:03--  http://ldap/controlies
> Resolviendo ldap... 172.23.231.3
> Connecting to ldap|172.23.231.3|:80... conectado.
> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
> *Localización: /init/default/user/login?_next=/init/default/index 
> [siguiendo]*
> *--2014-05-31 21:12:03-- 
>  http://ldap/init/default/user/login?_next=/init/default/index 
> *
> *Reusing existing connection to ldap:80.*
> *Petición HTTP enviada, esperando respuesta... 404 Not Found*
> *2014-05-31 21:12:03 ERROR 404: Not Found.*
>
>
> From the web browser the error is:
>
> Not Found
> The requested URL /init/default/user/login was not found on this server.
>
>
> The apache error log is:
>
> [Thu May 29 13:14:56 2014] [error] [client 172.23.231.9] File does not 
> exist: /var/www/init, referer: http://ldap/ 
>
>
> Which may be the reason for the incorrect mapping and subsequent error?
>
> Thanks
>
>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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')



On Wednesday, June 11, 2014 5:43:29 PM UTC+2, Louis Amon wrote:
>
> I found an answer to my own question :
> I split my model (plugin_name.py) into multiple files (0_settings.py, 
> 1_user.py, etc.) and put them all in a folder ./models/plugin_name/
>
> Web2py does detect that all my model files belong to the same plugin and 
> packs them together.
>
>
> *Another problem happens if I do things that way tho :*
>
> I use a database_uri as plugin parameter to define models (tables, fields, 
> callbacks, etc.) in my plugin.
>
>- When I access this database from appadmin, the tables work fine 
>(validators, callback, everything).
>- When I access this database from my main application (the one onto 
>which my plugin is installed), my database isn't recognized at all.
>
>
> From lurking on this fine forum, I established that I have 3 options here :
>
>1. Work around database cooperation (
>http://web2py.com/books/default/chapter/29/04#Cooperation)
>2. Use the auto_import=true argument in the DAL
>3. Rename the model files that came with my plugin, so all model 
>features are available in the global namespace
>
> So far, *I am unsatisfied with all 3 options*, with a good reason for 
> each of those :
>
>1. Because I have dependencies between tables which makes it very 
>difficult to cleanly manage all those imports
>2. Because auto_import doesn't manage to retrieve callbacks & 
>validators, which leaves me with half the work left to do
>3. Because it would defeat the purpose of making a plugin in the first 
>place
>
>
> I'm a mere padawan on this fine community, so if a web2py guru happens to 
> read this thread I would appreciate any tip he could provide to face this 
> issue !
>
>
> On Friday, May 23, 2014 2:06:42 PM UTC+2, Louis Amon wrote:
>>
>> I am trying to build a big 'plugin component', with a plugin manager and 
>> therefore using the full naming conventions specified in the doc.
>>
>> My model is starting to be huge (1000+ lines) and I'm trying to split it 
>> into multiple files.
>>
>>
>> Is there a way to name these files so that web2py still understands that 
>> they're part of my plugin ?
>>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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
import sys
import wsgiref.handlers

path = os.path.dirname(os.path.abspath(__file__))
path = "/home/myuser/resources/web2py/"
os.chdir(path)

if not os.path.isdir('applications'):
raise RuntimeError('Running from the wrong folder')

sys.path = [path] + [p for p in sys.path if not p == path]

import gluon.main

wsgiref.handlers.CGIHandler().run(gluon.main.wsgibase)


And everything is working ok except the app components, that returns a 
502 Bad Gateway error.


I know that there are many better ways to run web2py, but for this 
project cgi is the only one. So some help with this will be appreciated.


--
Nunca digas nunca, di mejor: gracias, permiso, disculpe.

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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 Groups "web2py-users" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 called). The 
exception is when the "appadmin" controller is called -- in that case, all 
models in all subfolders are run.

Anthony

On Friday, June 13, 2014 8:50:04 AM UTC-4, Louis Amon wrote:
>
> 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')
>
>
>
> On Wednesday, June 11, 2014 5:43:29 PM UTC+2, Louis Amon wrote:
>>
>> I found an answer to my own question :
>> I split my model (plugin_name.py) into multiple files (0_settings.py, 
>> 1_user.py, etc.) and put them all in a folder ./models/plugin_name/
>>
>> Web2py does detect that all my model files belong to the same plugin and 
>> packs them together.
>>
>>
>> *Another problem happens if I do things that way tho :*
>>
>> I use a database_uri as plugin parameter to define models (tables, 
>> fields, callbacks, etc.) in my plugin.
>>
>>- When I access this database from appadmin, the tables work fine 
>>(validators, callback, everything).
>>- When I access this database from my main application (the one onto 
>>which my plugin is installed), my database isn't recognized at all.
>>
>>
>> From lurking on this fine forum, I established that I have 3 options here 
>> :
>>
>>1. Work around database cooperation (
>>http://web2py.com/books/default/chapter/29/04#Cooperation)
>>2. Use the auto_import=true argument in the DAL
>>3. Rename the model files that came with my plugin, so all model 
>>features are available in the global namespace
>>
>> So far, *I am unsatisfied with all 3 options*, with a good reason for 
>> each of those :
>>
>>1. Because I have dependencies between tables which makes it very 
>>difficult to cleanly manage all those imports
>>2. Because auto_import doesn't manage to retrieve callbacks & 
>>validators, which leaves me with half the work left to do
>>3. Because it would defeat the purpose of making a plugin in the 
>>first place
>>
>>
>> I'm a mere padawan on this fine community, so if a web2py guru happens to 
>> read this thread I would appreciate any tip he could provide to face this 
>> issue !
>>
>>
>> On Friday, May 23, 2014 2:06:42 PM UTC+2, Louis Amon wrote:
>>>
>>> I am trying to build a big 'plugin component', with a plugin manager and 
>>> therefore using the full naming conventions specified in the doc.
>>>
>>> My model is starting to be huge (1000+ lines) and I'm trying to split it 
>>> into multiple files.
>>>
>>>
>>> Is there a way to name these files so that web2py still understands that 
>>> they're part of my plugin ?
>>>
>>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 so I 
uploaded that from my workstation to the heroku environment using the 
heroku postgres restore tool. I had to use fake_migrate_all to get a 
working DB without any tickets. Is there a smart way to get DB migrations 
working on Heroku itself when you already have a DB?

To clarify:
Should I rename local .table files with another prefix, matching the Heroku 
postgres connection URI and upload them also when I deploy a new version of 
the app, or is there a better way?


-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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=='pending' : user account requires approval 

if registration_key== : user account requires email verification 

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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),
**{'_data-toggle': 'modal',  '_data-target' : 
'#myModal',
   '_class' : 'two btn btn-success', '_id' : 
'show'})]
Inside this modal I have a submit button with a call to a ReportLab method 
that returns a response.stream. Within the modal it returns the raw PDF 
data(garbage) instead of initiating the automatic download as the same code 
does on non-component views.

-- 
This message is for named person(s) only.  It may contain confidential 
and/or legally privileged information.  No confidentiality or privilege is 
waived or lost should mis-transmission occur.  If you receive this message 
in error, delete it (and all copies) and notify the sender.  You must not, 
directly or indirectly,use, disclose, distribute, print, or copy any part 
of this message if you are not the intended recipient. GAD GROUP 
TECHNOLOGY, INC. reserves the right to monitor all e-mail communications 
through its networks.

Any views expressed in this message are those of the individual sender, 
except where the message states otherwise and the sender is authorized to 
state them to be the views of any such entity.

This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, INC.

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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('Apply Payment',
> _onclick="web2py_component('%s', 
> 'modalinfo');" % \
>  URL('default', 'applypayment2.load', 
> args=row.Inv_Header.id),
> **{'_data-toggle': 'modal',  '_data-target' : 
> '#myModal',
>'_class' : 'two btn btn-success', '_id' : 
> 'show'})]
> Inside this modal I have a submit button with a call to a ReportLab method 
> that returns a response.stream. Within the modal it returns the raw PDF 
> data(garbage) instead of initiating the automatic download as the same code 
> does on non-component views.
>
> This message is for named person(s) only.  It may contain confidential 
> and/or legally privileged information.  No confidentiality or privilege is 
> waived or lost should mis-transmission occur.  If you receive this message 
> in error, delete it (and all copies) and notify the sender.  You must not, 
> directly or indirectly,use, disclose, distribute, print, or copy any part 
> of this message if you are not the intended recipient. GAD GROUP 
> TECHNOLOGY, INC. reserves the right to monitor all e-mail communications 
> through its networks.
>
> Any views expressed in this message are those of the individual sender, 
> except where the message states otherwise and the sender is authorized to 
> state them to be the views of any such entity.
>
> This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, 
> INC.
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 web2py, the course has the following tutorials -

1. Quick-start + Hello World app

2. Deploying an app to Python Anywhere

3. seconds2minutes app

4. Two sentiment analysis apps (interacting with the Twitter API)

5. Movie Suggester (interacting with the Rotten Tomatoes API)

6. Basic blog app

7. Task Manager App

8. REST basics app


-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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
- 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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
server is started, and even initialize a global instance of myclass?

Best,

me

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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?

Thank you very much

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 inserted reorder record then does 
something with it.


def oncreatereorderhandler(form):
myid = form.vars.id
newreorderrow = db.reorder(myid)
#now do something with newreorderrow


Generally this works well.  form.vars.id correctly corresponds to the id of 
the newly inserted row and life is happy.  The problem occurs when I put a 
database trigger on the reorder table that fires after the insert. 
 Whenever this trigger is on the database the value of form.vars.id is 
nonsense.  The actual id of the inserted row is fine it's just that the 
value of form.vars.id in now way corresponds to it.  For example, after the 
trigger is added, the values of form.vars.id will be 4 for the very next 
insert.  For every insert after the value will increment by 3 (eg 4, 7, 10, 
13, etc).  When I remove the trigger everything returns to normal.  

How is form.vars.id populated and how would a DB trigger interfere?

Here's the trigger and associated procedure.   It was generated by 
symmetricds.

CREATE TRIGGER sym_on_i_for_rrdr_trggr_crp
  AFTER INSERT
  ON reorder
  FOR EACH ROW
  EXECUTE PROCEDURE fsym_on_i_for_rrdr_trggr_crp();


-- Function: fsym_on_i_for_rrdr_trggr_crp()

-- DROP FUNCTION fsym_on_i_for_rrdr_trggr_crp();

CREATE OR REPLACE FUNCTION fsym_on_i_for_rrdr_trggr_crp()
  RETURNS trigger AS
$BODY$ 
  
 begin 

   if 1=1 and 
"public".sym_triggers_disabled() = 0 then   

  insert into "public".sym_data 

(table_name, 
event_type, trigger_hist_id, row_data, channel_id, transaction_id, 
source_node_id, external_data, create_time) 
   values( 


 'reorder', 

 'I',   


8, 

  
  case when new."uuid" is null then '' else '"' || 
replace(replace(cast(new."uuid" as varchar),$$\$$,$$\\$$),'"',$$\"$$) || 
'"' end||','||
  case when new."id" is null then '' else '"' || cast(cast(new."id" 
as numeric) as varchar) || '"' end||','||
  case when new."modified_on" is null then '' else '"' || 
to_char(new."modified_on", '-MM-DD HH24:MI:SS.US') || '"' end||','||
  case when new."productid" is null then '' else '"' || 
replace(replace(cast(new."productid" as varchar),$$\$$,$$\\$$),'"',$$\"$$) 
|| '"' end||','||
  case when new."reorderquantity" is null then '' else '"' || 
cast(cast(new."reorderquantity" as numeric) as varchar) || '"' end||','||
  case when new."receivedquantity" is null then '' else '"' || 
cast(cast(new."receivedquantity" as numeric) as varchar) || '"' end||','||
  case when new."reorderdate" is null then '' else '"' || 
to_char(new."reorderdate", '-MM-DD HH24:MI:SS.US') || '"' end||','||
  case when new."expectedreceivedate" is null then '' else '"' || 
to_char(new."expectedreceivedate", '-MM-DD HH24:MI:SS.US') || '"' 
end||','||
  case when new."vendorso" is null then '' else '"' || 
replace(replace(cast(new."vendorso" as varchar),$$\$$,$$\\$$),'"',$$\"$$) 
|| '"' end||','||
  case when new."customerpo" is null then '' else '"' || 
replace(replace(cast(new."customerpo" as varchar),$$\$$,$$\\$$),'"',$$\"$$) 
|| '"' end||','||
  case when new."edigenerated" is null then '' else '"' || 
replace(replace(cast(new."edigenerated" as 
varchar),$$\$$,$$\\$$),'"',$$\"$$) || '"' end||','||
  case when new."active" is

[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 = (
('/App-name/(?P.*)/$c/$f/', '/App-name/$c/$f/\g'),)
routes_out = (
('/App-name/$c/$f/\g', '/App-name/(?P.*)/$c/$f/'),)


but its not work any one can help me to resolve my problem 
thnxs alot

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 is submitted or the page is 
refreshed, the string is set back to blank. I tried working around this by 
using the sessions class to store the variable and even using the web2py 
Storage class to store away the variable in a dictionary, but neither 
method worked. I was wondering if anyone has a solution to this?

Thanks in advance!

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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.txt'))
data = json.load(infile)
return dict(data=data)

 
view:
{{extend 'layout.html'}}


ForceDirected - Force Directed Static Graph











{{=data}}









Force Directed Static Graph
 

A static JSON Graph structure is used as input for this 
visualization.
You can zoom and pan the visualization by 
scrolling and dragging.
You can change node positions by dragging the nodes 
around.
The clicked node's connections are displayed in a relations 
list in the right column.
The JSON static data is customized to provide different node 
types, colors and widths.






  


















example1.js
 
file:
var labelType, useGradients, nativeTextSupport, animate;

(function() {
  var ua = navigator.userAgent,
  iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i),
  typeOfCanvas = typeof HTMLCanvasElement,
  nativeCanvasSupport = (typeOfCanvas == 'object' || typeOfCanvas == 
'function'),
  textSupport = nativeCanvasSupport 
&& (typeof 
document.createElement('canvas').getContext('2d').fillText == 'function');
  //I'm setting this based on the fact that ExCanvas provides text support 
for IE
  //and that as of today iPhone/iPad current text support is lame
  labelType = (!nativeCanvasSupport || (textSupport && !iStuff))? 'Native' 
: 'HTML';
  nativeTextSupport = labelType == 'Native';
  useGradients = nativeCanvasSupport;
  animate = !(iStuff || !nativeCanvasSupport);
})();

var Log = {
  elem: false,
  write: function(text){
if (!this.elem) 
  this.elem = document.getElementById('log');
this.elem.innerHTML = text;
this.elem.style.left = (500 - this.elem.offsetWidth / 2) + 'px';
  }
};


function init(){
  // init data
  var json = {{=XML(data)}};
  // end
  // init ForceDirected
  var fd = new $jit.ForceDirected({
//id of the visualization container
injectInto: 'infovis',
//Enable zooming and panning
//by scrolling and DnD
Navigation: {
  enable: true,
  //Enable panning events only if we're dragging the empty
  //canvas (and not a node).
  panning: 'avoid nodes',
  zooming: 10 //zoom speed. higher is more sensible
},
// Change node and edge styles such as
// color and width.
// These properties are also set per node
// with dollar prefixed data-properties in the
// JSON structure.
Node: {
  overridable: true
},
Edge: {
  overridable: true,
  color: '#23A4FF',
  lineWidth: 0.4
},
//Native canvas text styling
Label: {
  type: labelType, //Native or HTML
  size: 10,
  style: 'bold'
},
//Add Tips
Tips: {
  enable: true,
  onShow: function(tip, node) {
//count connections
var count = 0;
node.eachAdjacency(function() { count++; });
//display node info in tooltip
tip.innerHTML = "" + node.name + ""
  + "connections: " + count + 
"";
  }
},
// Add node events
Events: {
  enable: true,
  type: 'Native',
  //Change cursor style when hovering a node
  onMouseEnter: function() {
fd.canvas.getElement().style.cursor = 'move';
  },
  onMouseLeave: function() {
fd.canvas.getElement().style.cursor = '';
  },
  //Update node positions when dragged
  onDragMove: function(node, eventInfo, e) {
  var pos = eventInfo.getPos();
  node.pos.setc(pos.x, pos.y);
  fd.plot();
  },
  //Implement the same handler for touchscreens
  onTouchMove: function(node, eventInfo, e) {
$jit.util.event.stop(e); //stop default touchmove event
this.onDragMove(node, eventInfo, e);
  },
  //Add also a click handler to nodes
  onClick: function(node) {
if(!node) return;
// Build the right column relations list.
// This is done by traversing the clicked node connections.
var html = "" + node.name + " connections:",
list = [];
node.eachAdjacency(function(adj){
  list.push(adj.nodeTo.name);
});
//append connections information
$jit.id('inner-details').innerHTML = html + list.join("") 
+ "";
  }
},
//Number of iterations for the FD algorithm
iterations: 200,
//Edge length
levelDistance: 130,
// Add text to the labels. This method is only triggered
// on label creation and only for DOM labels (not native canvas ones).

[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:reference.
The database is not large - say 1000. 
Using the SQLFORM.widgets.multiple.widget style = "ul", the non 
"ul" example will be easier than the "ul" example - I think my "seconded 
version" will require the "ul" style.
 
The context: I am looking to create answer tables.  THREE types are 
required.
 
1. Consider a list (10 lines down the page with ONE column for answers) of 
say 10 text descriptors, to the right of each descriptor should be 
one checkbox (or other) per line, with a 1-10 selection and the usual not 
blank condition.
 
2. A second required version:
 Similar list (10 lines down the page), text descriptors, to the right of 
each descriptor should be a checkbox where 100 "points" can be shared down 
the e.g.10 long list, checked, on the fly, they add to 100, do not allow 
submission until they add to 100.
 
 3. A third required version:
Similar list (10 lines down the page), text descriptors - same as above - 
but with THREE "answer" columns, all THREE should have one checkbox (or 
other) per each of the 10 lines, with the 1-10 selection. 
 
I trust this is clear.
 
Much appreciated
Martin
 
 
 

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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/', '/appname/$c/index/$id'),

('/appname/$id/$c/$f/$anything', '/appname/$c/$f/$id/$anything'), ) 
routes_out = ( ('/appname/$c/$f/$id', '/appname/$id/$c/$f'), 

('/appname/$c/$f/$id/$anything', '/appname/$id/$c/$f/$anything'),

)


On Wednesday, 11 June 2014 03:01:26 UTC-5, Mohammed Suleiman wrote:
>
>
>
>
> 
>  
>   
> 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 = (
> ('/App-name/(?P.*)/$c/$f/', '/App-name/$c/$f/\g'),)
> routes_out = (
> ('/App-name/$c/$f/\g', '/App-name/(?P.*)/$c/$f/'),)
>
>
> but its not work any one can help me to resolve my problem 
> thnxs alot
>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 QUERY:*
> db.table.id_field_list.contains(db.table2.id)
>
> *MYSQL QUERY:*
> SELECT * FROM table, table2 WHERE (table.id_field_list LIKE 
> (CONCAT('%|',(REPLACE((REPLACE(CAST(table2.id AS 
> LONGTEXT),'%','%%')),'|','||')),'|%')))
>
> The error is with CAST()
>
> Reading mysql documentation, CAST() does not support LONGTEXT
> *http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast 
> *
>
> And there are some discussions on google about CAST with LONGTEXT in MYSQL 
> that also said it is not compatible 
>
>
> If you want to test this behavior, try this command in MYSQL:
>
>
> SELECT CAST(123 as LONGTEXT);
> you will receive the error
>
> then try:
>
> SELECT CAST(123 as char);
> and everything goes fine
>
>
> Is there any way to fix this issue in official version by removing the 
> CAST from list: fields for MYSQL or any other better idea?
>
> Thanks
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 "reorder" using a 
> SQLFORM.grid.   I have implemented the oncreate call back.  My oncreate 
> callback gets the id of the newly inserted reorder record then does 
> something with it.
>
>
> def oncreatereorderhandler(form):
> myid = form.vars.id
> newreorderrow = db.reorder(myid)
> #now do something with newreorderrow
>
>
> Generally this works well.  form.vars.id correctly corresponds to the id 
> of the newly inserted row and life is happy.  The problem occurs when I put 
> a database trigger on the reorder table that fires after the insert. 
>  Whenever this trigger is on the database the value of form.vars.id is 
> nonsense.  The actual id of the inserted row is fine it's just that the 
> value of form.vars.id in now way corresponds to it.  For example, after 
> the trigger is added, the values of form.vars.id will be 4 for the very 
> next insert.  For every insert after the value will increment by 3 (eg 4, 
> 7, 10, 13, etc).  When I remove the trigger everything returns to normal.  
>
> How is form.vars.id populated and how would a DB trigger interfere?
>
> Here's the trigger and associated procedure.   It was generated by 
> symmetricds.
>
> CREATE TRIGGER sym_on_i_for_rrdr_trggr_crp
>   AFTER INSERT
>   ON reorder
>   FOR EACH ROW
>   EXECUTE PROCEDURE fsym_on_i_for_rrdr_trggr_crp();
>
>
> -- Function: fsym_on_i_for_rrdr_trggr_crp()
>
> -- DROP FUNCTION fsym_on_i_for_rrdr_trggr_crp();
>
> CREATE OR REPLACE FUNCTION fsym_on_i_for_rrdr_trggr_crp()
>   RETURNS trigger AS
> $BODY$ 
>   
>  begin 
> 
>if 1=1 and 
> "public".sym_triggers_disabled() = 0 then   
> 
>   insert into "public".sym_data 
> 
> (table_name, 
> event_type, trigger_hist_id, row_data, channel_id, transaction_id, 
> source_node_id, external_data, create_time) 
>values( 
> 
> 
>  'reorder', 
> 
>  'I',   
> 
> 
> 8, 
> 
>   
>   case when new."uuid" is null then '' else '"' || 
> replace(replace(cast(new."uuid" as varchar),$$\$$,$$\\$$),'"',$$\"$$) || 
> '"' end||','||
>   case when new."id" is null then '' else '"' || 
> cast(cast(new."id" as numeric) as varchar) || '"' end||','||
>   case when new."modified_on" is null then '' else '"' || 
> to_char(new."modified_on", '-MM-DD HH24:MI:SS.US') || '"' end||','||
>   case when new."productid" is null then '' else '"' || 
> replace(replace(cast(new."productid" as varchar),$$\$$,$$\\$$),'"',$$\"$$) 
> || '"' end||','||
>   case when new."reorderquantity" is null then '' else '"' || 
> cast(cast(new."reorderquantity" as numeric) as varchar) || '"' end||','||
>   case when new."receivedquantity" is null then '' else '"' || 
> cast(cast(new."receivedquantity" as numeric) as varchar) || '"' end||','||
>   case when new."reorderdate" is null then '' else '"' || 
> to_char(new."reorderdate", '-MM-DD HH24:MI:SS.US') || '"' end||','||
>   case when new."expectedreceivedate" is null then '' else '"' || 
> to_char(new."expectedreceivedate", '-MM-DD HH24:MI:SS.US') || '"' 
> end||','||
>   case when new."vendorso" is null then '' else '"' || 
> replace(replace(cast(new."vendorso" as varchar),$$\$$,$$\\$$),'"',$$\"$$) 
> || '"' end||','||
>   case when new."customerpo" is null then '' else '"' || 
> repla

[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 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?
>
> Thank you very much
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 external referencens have the 
> SCRIPT_NAME prefix
> if not status.startswith('3'):
> return self._start_response(status, headers, info)
> # status: 3xx (redirect)
> _headers = []
> for key, value in headers:
># if key == 'Set-Cookie':
> # don't modify the cookie, it already has a modified 
> location
> #return self._start_response(status, headers, info)
> # relative URLs start with '/', absolute URLs start with 'http'
> if key == 'Location' and value.startswith('/'):
> value = self.script_name + value
> _headers.append((key, value))
> return self._start_response(status, _headers, info)
>
> it runs without errors.
>
> Why?
>
> El domingo, 1 de junio de 2014 13:06:18 UTC+2, Alfonso Pastor Sierra 
> escribió:
>>
>> Hello, 
>>
>> I have a web2py application with apache:
>>
>> cat /etc/apache2/conf.d/controlies-apache 
>>
>> WSGIScriptAlias /controlies /var/web2py/subwsgihandler.py
>>
>> WSGIDaemonProcess web2py user=www-data group=www-data \
>>   home=/var processes=5 \
>>   maximum-requests=1 \
>>   threads=1
>>
>> 
>> Order deny,allow
>> Allow from all
>> WSGIProcessGroup web2py
>> 
>>
>> With Debian Squeeze when I run:
>>
>> # wget http://ldap/controlies
>>
>> The result is:
>>  
>>
>> --2014-05-31 21:10:19--  http://ldap/controlies
>> Resolviendo ldap... 172.23.231.3
>> Connecting to ldap|172.23.231.3|:80... conectado.
>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>> *Localización: 
>> /controlies/init/default/user/login?_next=/controlies/init/default/index 
>> [siguiendo]*
>> *--2014-05-31 21:10:19-- 
>>  
>> http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index
>>  
>> *
>> *Reusing existing connection to ldap:80.*
>> *Petición HTTP enviada, esperando respuesta... 200 OK*
>> Longitud: 12488 (12K) [text/html]
>> Saving to: `controlies'
>>
>> 100%[=>] 12.488  --.-K/s   in 0s  
>>
>> 2014-05-31 21:10:19 (803 MB/s) - `controlies' saved [12488/12488]
>>
>>
>> But, after upgrading the server to Debian Wheezy when I run:
>>
>>
>> #wget http://ldap/controlies
>>
>>
>> The result is:
>>  
>>
>> --2014-05-31 21:12:03--  http://ldap/controlies
>> Resolviendo ldap... 172.23.231.3
>> Connecting to ldap|172.23.231.3|:80... conectado.
>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>> *Localización: /init/default/user/login?_next=/init/default/index 
>> [siguiendo]*
>> *--2014-05-31 21:12:03-- 
>>  http://ldap/init/default/user/login?_next=/init/default/index 
>> *
>> *Reusing existing connection to ldap:80.*
>> *Petición HTTP enviada, esperando respuesta... 404 Not Found*
>> *2014-05-31 21:12:03 ERROR 404: Not Found.*
>>
>>
>> From the web browser the error is:
>>
>> Not Found
>> The requested URL /init/default/user/login was not found on this server.
>>
>>
>> The apache error log is:
>>
>> [Thu May 29 13:14:56 2014] [error] [client 172.23.231.9] File does not 
>> exist: /var/www/init, referer: http://ldap/ 
>>
>>
>> Which may be the reason for the incorrect mapping and subsequent error?
>>
>> Thanks
>>
>>
>>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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
import myclass
if not myclass.initialized:
...
myclass.initialized = True
# end

and make sure the initialization code is thread safe.

On Friday, 13 June 2014 09:34:13 UTC-5, chuan137 wrote:
>
>
> 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 
> server is started, and even initialize a global instance of myclass?
>
> Best,
>
> me
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 verification. It is  user to authenticate user in 
the verify function until the email is verified. Once the email is 
verified, the registration_key is set to "".
if the registration requires approval, after email verification, the 
registration_key is set to "pending" and the administrator has to manually 
deleted to approve the user.

At any point the administrator can set a user registration_key to "blocked" 
to prevent the user from logging in.

The password_reset_key  is the uuid used to identify a user when they ask 
for a password reset link. the uuid appears in the link and expires when 
the user resets the password.


On Friday, 13 June 2014 09:50:48 UTC-5, Michael Beller wrote:
>
> 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=='pending' : user account requires approval 
>
> if registration_key== : user account requires email verification 
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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ó:
>
> 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 external referencens have the 
>> SCRIPT_NAME prefix
>> if not status.startswith('3'):
>> return self._start_response(status, headers, info)
>> # status: 3xx (redirect)
>> _headers = []
>> for key, value in headers:
>># if key == 'Set-Cookie':
>> # don't modify the cookie, it already has a modified 
>> location
>> #return self._start_response(status, headers, info)
>> # relative URLs start with '/', absolute URLs start with 
>> 'http'
>> if key == 'Location' and value.startswith('/'):
>> value = self.script_name + value
>> _headers.append((key, value))
>> return self._start_response(status, _headers, info)
>>
>> it runs without errors.
>>
>> Why?
>>
>> El domingo, 1 de junio de 2014 13:06:18 UTC+2, Alfonso Pastor Sierra 
>> escribió:
>>>
>>> Hello, 
>>>
>>> I have a web2py application with apache:
>>>
>>> cat /etc/apache2/conf.d/controlies-apache 
>>>
>>> WSGIScriptAlias /controlies /var/web2py/subwsgihandler.py
>>>
>>> WSGIDaemonProcess web2py user=www-data group=www-data \
>>>   home=/var processes=5 \
>>>   maximum-requests=1 \
>>>   threads=1
>>>
>>> 
>>> Order deny,allow
>>> Allow from all
>>> WSGIProcessGroup web2py
>>> 
>>>
>>> With Debian Squeeze when I run:
>>>
>>> # wget http://ldap/controlies
>>>
>>> The result is:
>>>  
>>>
>>> --2014-05-31 21:10:19--  http://ldap/controlies
>>> Resolviendo ldap... 172.23.231.3
>>> Connecting to ldap|172.23.231.3|:80... conectado.
>>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>>> *Localización: 
>>> /controlies/init/default/user/login?_next=/controlies/init/default/index 
>>> [siguiendo]*
>>> *--2014-05-31 21:10:19-- 
>>>  
>>> http://ldap/controlies/init/default/user/login?_next=/controlies/init/default/index
>>>  
>>> *
>>> *Reusing existing connection to ldap:80.*
>>> *Petición HTTP enviada, esperando respuesta... 200 OK*
>>> Longitud: 12488 (12K) [text/html]
>>> Saving to: `controlies'
>>>
>>> 100%[=>] 12.488  --.-K/s   in 0s  
>>>
>>> 2014-05-31 21:10:19 (803 MB/s) - `controlies' saved [12488/12488]
>>>
>>>
>>> But, after upgrading the server to Debian Wheezy when I run:
>>>
>>>
>>> #wget http://ldap/controlies
>>>
>>>
>>> The result is:
>>>  
>>>
>>> --2014-05-31 21:12:03--  http://ldap/controlies
>>> Resolviendo ldap... 172.23.231.3
>>> Connecting to ldap|172.23.231.3|:80... conectado.
>>> *Petición HTTP enviada, esperando respuesta... 303 SEE OTHER*
>>> *Localización: /init/default/user/login?_next=/init/default/index 
>>> [siguiendo]*
>>> *--2014-05-31 21:12:03-- 
>>>  http://ldap/init/default/user/login?_next=/init/default/index 
>>> *
>>> *Reusing existing connection to ldap:80.*
>>> *Petición HTTP enviada, esperando respuesta... 404 Not Found*
>>> *2014-05-31 21:12:03 ERROR 404: Not Found.*
>>>
>>>
>>> From the web browser the error is:
>>>
>>> Not Found
>>> The requested URL /init/default/user/login was not found on this server.
>>>
>>>
>>> The apache error log is:
>>>
>>> [Thu May 29 13:14:56 2014] [error] [client 172.23.231.9] File does not 
>>> exist: /var/www/init, referer: http://ldap/ 
>>>
>>>
>>> Which may be the reason for the incorrect mapping and subsequent error?
>>>
>>> Thanks
>>>
>>>
>>>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 QUERY:*
>> db.table.id_field_list.contains(db.table2.id)
>>
>> *MYSQL QUERY:*
>> SELECT * FROM table, table2 WHERE (table.id_field_list LIKE 
>> (CONCAT('%|',(REPLACE((REPLACE(CAST(table2.id AS 
>> LONGTEXT),'%','%%')),'|','||')),'|%')))
>>
>> The error is with CAST()
>>
>> Reading mysql documentation, CAST() does not support LONGTEXT
>> *http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast 
>> *
>>
>> And there are some discussions on google about CAST with LONGTEXT in 
>> MYSQL that also said it is not compatible 
>>
>>
>> If you want to test this behavior, try this command in MYSQL:
>>
>>
>> SELECT CAST(123 as LONGTEXT);
>> you will receive the error
>>
>> then try:
>>
>> SELECT CAST(123 as char);
>> and everything goes fine
>>
>>
>> Is there any way to fix this issue in official version by removing the 
>> CAST from list: fields for MYSQL or any other better idea?
>>
>> Thanks
>>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 verification. It is  user to authenticate user 
> in the verify function until the email is verified. Once the email is 
> verified, the registration_key is set to "".
> if the registration requires approval, after email verification, the 
> registration_key is set to "pending" and the administrator has to manually 
> deleted to approve the user.
>
> At any point the administrator can set a user registration_key to 
> "blocked" to prevent the user from logging in.
>
> The password_reset_key  is the uuid used to identify a user when they ask 
> for a password reset link. the uuid appears in the link and expires when 
> the user resets the password.
>
>
> On Friday, 13 June 2014 09:50:48 UTC-5, Michael Beller wrote:
>>
>> 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=='pending' : user account requires approval 
>>
>> if registration_key== : user account requires email verification 
>>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 under particular circumstances (i.e. when the page is updated with 
> an ajax call, rather than refreshed or loaded through a link), which makes 
> me suspect that the "animation" in this particular case is a side-effect of 
> the plugin's basic functionality, and something is going slightly screwy.
>
> I tried masonry (that was actually the first one I tried), and there was 
> some issue with that as well, but that was in the early stages of 
> development, and I've since made some fixes to the site, so perhaps it's 
> worth another look...
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 sessions for whatever reason and end up losing the 
> information already filled. For this and other reasons I wanted to provide 
> a different behaviour to these forms where each input field updates the 
> record on the database as soon as its input field is released ('focusOut' 
> event on jQuery). Ideally, the server would reply with 'success' or an 
> error message so users know when they can move on to another field (without 
> refreshing the whole page). By the end of the form, the user wouldn't have 
> to review things that were written long ago since these were all already 
> validated.
>
> Now, I know this can be tricky due to database constrains but because i 
> need to do this very often (multiple fields and multiple forms), I thought 
> it would be useful to automate it, maybe even by having on the db Field 
> something like '..auto_update=True' (merely a suggestion) but before 
> getting there, I would like to know if anyone has faced this problem and if 
> yes what solution did you employ? 
>
> Thank you in advance,
> Francisco
>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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
>
>  --
> 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 Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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 under particular circumstances (i.e. when the page is updated with 
>> an ajax call, rather than refreshed or loaded through a link), which makes 
>> me suspect that the "animation" in this particular case is a side-effect of 
>> the plugin's basic functionality, and something is going slightly screwy.
>>
>> I tried masonry (that was actually the first one I tried), and there was 
>> some issue with that as well, but that was in the early stages of 
>> development, and I've since made some fixes to the site, so perhaps it's 
>> worth another look...
>>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 briefly show the last character 
entered before the masking character covers it.)

/dps
 

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
once it is provided input field by input field (on focusOut event) , rather 
than just doing all at once when the form is submitted. Anyway, thanks :)

Francisco


On Friday, 13 June 2014 21:06:48 UTC+1, Derek wrote:
>
> 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 sessions for whatever reason and end up losing 
>> the information already filled. For this and other reasons I wanted to 
>> provide a different behaviour to these forms where each input field updates 
>> the record on the database as soon as its input field is released 
>> ('focusOut' event on jQuery). Ideally, the server would reply with 
>> 'success' or an error message so users know when they can move on to 
>> another field (without refreshing the whole page). By the end of the form, 
>> the user wouldn't have to review things that were written long ago since 
>> these were all already validated.
>>
>> Now, I know this can be tricky due to database constrains but because i 
>> need to do this very often (multiple fields and multiple forms), I thought 
>> it would be useful to automate it, maybe even by having on the db Field 
>> something like '..auto_update=True' (merely a suggestion) but before 
>> getting there, I would like to know if anyone has faced this problem and if 
>> yes what solution did you employ? 
>>
>> Thank you in advance,
>> Francisco
>>
>>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 from my phone...excuse any typos please!
>>
> Well, that there points to one reason   ;-)
>
> (It's not unusual for mobile apps to briefly show the last character
> entered before the masking character covers it.)
>
> /dps
>
>
> --
> 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 Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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:
>
> 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('Apply Payment',
>> _onclick="web2py_component('%s', 
>> 'modalinfo');" % \
>>  URL('default', 'applypayment2.load', 
>> args=row.Inv_Header.id),
>> **{'_data-toggle': 'modal',  '_data-target' : 
>> '#myModal',
>>'_class' : 'two btn btn-success', '_id' : 
>> 'show'})]
>> Inside this modal I have a submit button with a call to a ReportLab 
>> method that returns a response.stream. Within the modal it returns the raw 
>> PDF data(garbage) instead of initiating the automatic download as the same 
>> code does on non-component views.
>>
>> This message is for named person(s) only.  It may contain confidential 
>> and/or legally privileged information.  No confidentiality or privilege is 
>> waived or lost should mis-transmission occur.  If you receive this message 
>> in error, delete it (and all copies) and notify the sender.  You must not, 
>> directly or indirectly,use, disclose, distribute, print, or copy any part 
>> of this message if you are not the intended recipient. GAD GROUP 
>> TECHNOLOGY, INC. reserves the right to monitor all e-mail communications 
>> through its networks.
>>
>> Any views expressed in this message are those of the individual sender, 
>> except where the message states otherwise and the sender is authorized to 
>> state them to be the views of any such entity.
>>
>> This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, 
>> INC.
>>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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, 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 from my phone...excuse any typos please!
>>>
>> Well, that there points to one reason   ;-)
>>
>> (It's not unusual for mobile apps to briefly show the last character 
>> entered before the masking character covers it.)
>>
>> /dps
>>  
>>
>> -- 
>> 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 Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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/?fromgroups#!searchin/web2py/orderby$20$20case/web2py/B9iM-r1rV0A/jPMBmoSv2kgJ
 
) where CASE was used with orderby but I just couldn't understand how to 
get it working. 

Is this the way or is there an other way to do this?


Kenneth

-- 
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 Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.