[web2py] Comment for auth.auth_user.email

2016-09-11 Thread Gael Princivalle
Hello.

I would like to add a to auth.auth_user.email a comment like comment=('Only 
for login and service communication, not displayed to other users').

Is it possible?

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: How to code efficiently for multiple database engines with Exceptions

2016-09-11 Thread Joe Barnhart
It's more complicated than that.  There are obsolete versions of some 
libraries, such as libel, which need to be replaced.  However, those libs 
are not easily replaced because you can't simply "ln" an entry into the 
directory where it needs to go.  There are workarounds, and potential 
problems with the workarounds.  This is all on El Capitan so your milage 
may vary.

It's just an unholy mess.  I'm really surprised the PostgresSQL and Apple 
people can't come up with a way around it.  Or the psycopg2 people. 
 Whoever.

-- Joe


On Saturday, September 10, 2016 at 5:14:48 AM UTC-7, Julian Sanchez wrote:
>
> Hi Joe,
>
> psycopg2 installs on mac (I have it on 3).  'pip install' will fail 
> because psycopg2 needs the postgresql client libraries already installed. 
>  If you have homebrew just do a 'brew postgresql' followed by 'pip install 
> psycopg2'.  It should work.
>
> Cheers,
> Julian
>
> On Thursday, September 8, 2016 at 9:43:02 PM UTC-5, Joe Barnhart wrote:
>>
>> Hi Massimo --
>>
>> Two issues...
>>
>> 1.  I use a Mac.  For whatever reason, psycopg2 does not "pip install" on 
>> a Mac.  I researched it for a day or so -- even AFTER having had it WORKING 
>> on my system until I "upgraded" to El Capitan and it all quit.  I am so 
>> done with psycopg2 because its installation is crap.
>>
>> 2.  The future belongs to pypy and psycopg2 doesn't work with it.  pg8000 
>> does.  There is a psycopg2.cffi but I don't know how mature it is.
>>
>> It's all enough to make me want to switch to MySql!
>>
>> -- Joe
>>
>>
>> On Wednesday, September 7, 2016 at 5:38:57 PM UTC-7, Massimo Di Pierro 
>> wrote:
>>>
>>> I strongly recommend you do not use pg8000. We always run into issues 
>>> with it. 
>>>
>>> pip install psycopg2
>>>
>>> Massimo
>>>
>>  
>>
>

-- 
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] Can't get response.stream() to work

2016-09-11 Thread Joe Barnhart
This MUST be something I'm doing wrong.  I have used this very code -- even 
this method -- countless times but now it fails to stream the file.   The 
object  being streamed is a StringIO buffer of some file that I create on 
the fly.  I'm trying to download it with a provided file name and type. 
 This code has worked in the past, but I've been hammering on my site 
getting it "updated" and now it streams the word "None" every time.

If I stop and debug the buffer, I can see about 97K worth of text queued up 
and ready to go.  I've stepped it as far as the Response.stream() method 
and everything looks perfect.  But when the rubber hits the road, all I get 
is "None".  Here is the my code:

def _reg_getfile(now,idset):
from regexport import generate_regfile
from cStringIO import StringIO
buf = StringIO()
generate_regfile(idset, buf)
buf.seek(0)
response.headers['Content-Type']='application/sd3'
response.headers['Content-Disposition']='attachment; 
filename=reg-%s.sd3'%now.strftime('%y%m%d-%H%M%S')
return response.stream(buf)

And my response in a file named reg-160911-023542.sd3:

None

Help me prevent baldness here.  Because I'm sure I'm going to tear my hair 
out over this!

I'm using "Version 2.14.6-stable+timestamp.2016.05.09.19.18.48" and Python 
2.7.12 on a Mac under El Capitan (OS X ver. 10.11.6)

-- Joe

-- 
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: Comment for auth.auth_user.email

2016-09-11 Thread 黄祥
pls try :
auth.define_tables(username = True, signature = True)

custom_auth_table = db[auth.settings.table_user_name]

custom_auth_table.email.comment = T('Only for login and service 
communication, not displayed to other users')

auth.settings.table_user = custom_auth_table

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this 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 code efficiently for multiple database engines with Exceptions

2016-09-11 Thread Joe Barnhart
Of course that was LIBSSL before f-ing auto spell got ahold of it...

On Sunday, September 11, 2016 at 2:40:02 AM UTC-7, Joe Barnhart wrote:
>
> It's more complicated than that.  There are obsolete versions of some 
> libraries, such as libel, which need to be replaced.  However, those libs 
> are not easily replaced because you can't simply "ln" an entry into the 
> directory where it needs to go.  There are workarounds, and potential 
> problems with the workarounds.  This is all on El Capitan so your milage 
> may vary.
>
> It's just an unholy mess.  I'm really surprised the PostgresSQL and Apple 
> people can't come up with a way around it.  Or the psycopg2 people. 
>  Whoever.
>
> -- Joe
>
>
> On Saturday, September 10, 2016 at 5:14:48 AM UTC-7, Julian Sanchez wrote:
>>
>> Hi Joe,
>>
>> psycopg2 installs on mac (I have it on 3).  'pip install' will fail 
>> because psycopg2 needs the postgresql client libraries already installed. 
>>  If you have homebrew just do a 'brew postgresql' followed by 'pip install 
>> psycopg2'.  It should work.
>>
>> Cheers,
>> Julian
>>
>> On Thursday, September 8, 2016 at 9:43:02 PM UTC-5, Joe Barnhart wrote:
>>>
>>> Hi Massimo --
>>>
>>> Two issues...
>>>
>>> 1.  I use a Mac.  For whatever reason, psycopg2 does not "pip install" 
>>> on a Mac.  I researched it for a day or so -- even AFTER having had it 
>>> WORKING on my system until I "upgraded" to El Capitan and it all quit.  I 
>>> am so done with psycopg2 because its installation is crap.
>>>
>>> 2.  The future belongs to pypy and psycopg2 doesn't work with it. 
>>>  pg8000 does.  There is a psycopg2.cffi but I don't know how mature it is.
>>>
>>> It's all enough to make me want to switch to MySql!
>>>
>>> -- Joe
>>>
>>>
>>> On Wednesday, September 7, 2016 at 5:38:57 PM UTC-7, Massimo Di Pierro 
>>> wrote:

 I strongly recommend you do not use pg8000. We always run into issues 
 with it. 

 pip install psycopg2

 Massimo

>>>  
>>>
>>

-- 
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 the default applicaton of web2py

2016-09-11 Thread Alessio Varalta
Hi, I call my application with base_url+ name_application.

With  base_url web2py call welcome application, I want to change and with 
base_url i want to call my name_application. Where is the code to change?

-- 
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] why request.vars are added an additional key “records” with null value when I used the sqlform.grid?

2016-09-11 Thread Yibing Liu


My web2py version is 2.14.6.

I define a form in myview.html

   `




` 

 In my default controler function 'index' I want to deal with the 
request.vars passed from html.It works fine. Then I add a 
form=SQLFORM.grid(query) to my function, I find that the request.vars are 
added an additional key "records" with null value when the sqlform.grid() 
line is executed. So I debug into the source code, I find the line 2479 in 
sqlhtml.py is

elif not request.vars.records: request.vars.records = []

After the above line excuted my request.vars was added an additional 
key "records" with null value. My questions are,

1.How can I prevent adding the "record" key to my request.vars?

2.What's the purpose of the code

elif not request.vars.records: request.vars.records = []

-- 
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.