[web2py] Re: web2py session disable

2016-07-20 Thread T.R.Rajkumar

it should be routes_in = (('/init', '/init', dict(web2py_disable_session=
True))
no square brackets.

On Friday, January 8, 2016 at 4:30:17 PM UTC+5:30, T.R.Rajkumar wrote:
>
> I have in my routes.py in web2py folder the following.
> routes_in = (
>   ('/ts2', '/web_ts2_site/home/home'),
>   
> )
> routes_out = ()
>
> Now I want to disable session for web_ts2_site app. If I add the below it 
> gives error. How to go about that?
>
> routes_in = [('/web_ts2_site', '/web_ts2_site', dict(
> web2py_disable_session=True)]
>
> Thank you for reading.
>

-- 
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: Best way to send data from web2py client to web2py server

2016-07-20 Thread Michael Messmer
Are you talking about High Availability? Load Balancer and Centralized DB? 
Why and what kind of data?

On Wednesday, July 20, 2016 at 5:59:18 AM UTC-7, Aydin wrote:
>
> What's the best way to send data from web2py clients to a web2py server? 
> Especially when there are many web2py clients that at the same time send 
> data to the web2py server? Thanks for the help
>

-- 
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: UWSGI root vs limited user.

2016-07-20 Thread Michael Messmer
Sorry for the confusion.  And thanks!

On Wednesday, July 20, 2016 at 8:38:38 AM UTC-7, Niphlod wrote:
>
> ah, ok!!! me, I'm proud of myself very little these days
>
> but, and it's a big butI'm totally proud of you!
>
> On Wednesday, July 20, 2016 at 4:39:39 PM UTC+2, Michael Messmer wrote:
>>
>> I figured out my own problem.  ;)  Another admin didn't have to save me. 
>>  And i learned a new (to me) tool 'strace' to help myself.
>>
>>
>>
>>
>> On Wed, Jul 20, 2016 at 7:21 AM, Niphlod  wrote:
>>
>>> me, proud? of ?
>>>
>>> On Wednesday, July 20, 2016 at 8:02:55 AM UTC+2, Michael M wrote:

 Figured it out:

 Niplod you may be proud.  I ran strace in the service:

 [Unit]
 Description=uWSGI Emperor Service
 After=syslog.target

 [Service]
 EnvironmentFile=-/etc/sysconfig/uwsgi
 ExecStartPre=/bin/mkdir -p /run/uwsgi
 ExecStartPre=/bin/chown uwsgi:uwsgi /run/uwsgi
 ExecStart=/bin/strace -o /tmp/uwsgi.service /usr/sbin/uwsgi --ini 
 /etc/uwsgi.ini
 ExecReload=/bin/kill -HUP $MAINPID
 KillSignal=SIGINT
 Restart=always
 Type=notify
 StandardError=syslog
 NotifyAccess=all

 [Install]
 WantedBy=multi-user.target



 ---
 Which exposed this as i trolled through tons to find some keywords pop 
 out at:

 cat /tmp/uwsgi.service |wc -l
 15031

 cat /tmp/uwsgi.service |grep "Permission denied"
 openat(AT_FDCWD, "/opt/www-data/web2py/site-packages", 
 O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission 
 denied)
 openat(AT_FDCWD, "/opt/www-data/web2py/gluon", 
 O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission 
 denied)
 open("/opt/www-data/web2py/VERSION", O_RDONLY) = -1 EACCES (Permission 
 denied)

 so i: 
 chmod u+r /opt/www-data/web2py/VERSION
 chmod u+r /opt/www-data/web2py/site-packages
 chmod u+r /opt/www-data/web2py/gluon

 restarted ( systemctl restart uwsgi.service ) uwsgi

 Loaded perfectly.

 Web2py now running as limited user "uwsgi" and not root!!!WOOHOO






 On Monday, July 18, 2016 at 4:44:57 PM UTC-7, Michael Messmer wrote:
>
> Environment
> nginx & uwsgi
> Rhel7
> web2py: Version 2.14.6-stable+timestamp.2016.05.09.19.18.48
> (Running on Unknown, Python 2.7.5)
>
> ---
> uwsgi.ini file
> ---
> [uwsgi]
> master = true
> processes = 4
> max-requests = 50
>
> enable-threads = true
>
> chdir  = /opt/www-data/web2py
> module = wsgihandler:application
>
> plugin = python
> logto  = /var/log/nginx/uwsgi.log
>
> #gid = uwsgi
> #uid = uwsgi 
>
> socket = /run/uwsgi/web2py.sock
> chown-socket = uwsgi:nginx
> chmod-socket = 666
> vacuum = true
>
>
>
>
>
>
>
> ---
> running as root user & working
> ---
>
> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:38:43 2016] ***
> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January 
> 2016 19:52:54
> os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
> nodename: n01
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 8
> current working directory: /
> detected binary path: /usr/sbin/uwsgi
> chdir() to /opt/www-data/web2py
> your processes number limit is 63467
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> thunder lock: disabled (you can enable it with --thunder-lock)
> uwsgi socket 0 bound to UNIX address /run/uwsgi/web2py.sock fd 4
> uWSGI running as root, you can use --uid/--gid/--chroot options
> *** WARNING: you are running uWSGI as root !!! (use the --uid flag) 
> *** 
> Python version: 2.7.5 (default, Oct 11 2015, 17:47:16)  [GCC 4.8.3 
> 20140911 (Red Hat 4.8.3-9)]
> Python main interpreter initialized at 0xaa8ec0
> python threads support enabled
> your server socket listen backlog is limited to 100 connections
> your mercy for graceful operations on workers is 60 seconds
> mapped 363840 bytes (355 KB) for 4 cores
> *** Operational MODE: preforking ***
> WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaa8ec0 
> pid: 7140 (default app)
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 7140)
> spawned uWSGI worker 1 (pid: 7154, cores: 1)
> spawned uWSGI worker 2 (pid: 7155, cores: 1)
> spawned uWSGI worker 3 (pid: 7156, cores: 1)
> spawned uWSGI worker 4 (pid: 7157, cores: 1)
>
>
>
>
> 
> running as uwsgi user & not working
> 
>
> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16

Re: [web2py] Re: How active and 'professional' is web2py?

2016-07-20 Thread Ron Chatterjee
Part of the problem may be not any highly popular site ever used the 
framework. So, its capabilities are somewhat untested. If youtube for 
example used w2p framework, no one will question its performance. Just some 
thoughts...




On Wednesday, July 20, 2016 at 11:48:48 AM UTC-4, Richard wrote:
>
> web2py is really good framework and you won't find any other with a 
> learning curve as smooth as that...
>
> There is not seems that many major web site build over web2py, though I 
> know for sure that there is many data centric app lying around in LAN of 
> multiples business. 
>
> Forces of web2py are :
>
> It easses of use
> Being fullstack framework (battery included)
> Growth with you and your developping skills increase
> Reactive community
> Python
>
> Cons
> Disregarded by the purist :D
>
> Richard
>
>
> On Wed, Jul 20, 2016 at 10:51 AM, Carlos Zenteno  > wrote:
>
>> It is not a "professional" product but check Sahara Eden.  It is based in 
>> web2py, it has a framework S3 built on top of web2py and it is used in 
>> critical disaster operation when the app is put to the test at its maximum 
>> performance...
>>
>> I wonder if I should use Linux, it is really old and won prices many 
>> years ago...
>>
>> --
>> 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] Re: web2py session disable

2016-07-20 Thread luis . valladares
Hello!

Anyone can help here? im having exactly the same issue, my route is:

routes_in = [('/init', '/init', dict(web2py_disable_session=True)]

and i'm getting a ticket with any route in my system but if i comment that 
everything start working fine.

I dont use the session mechanism of web2py in my app and i want to fully 
disable the cookie generation and the session storage in certain apps, but 
i cant do it

El viernes, 8 de enero de 2016, 6:30:17 (UTC-4:30), T.R.Rajkumar escribió:
>
> I have in my routes.py in web2py folder the following.
> routes_in = (
>   ('/ts2', '/web_ts2_site/home/home'),
>   
> )
> routes_out = ()
>
> Now I want to disable session for web_ts2_site app. If I add the below it 
> gives error. How to go about that?
>
> routes_in = [('/web_ts2_site', '/web_ts2_site', dict(
> web2py_disable_session=True)]
>
> Thank you for reading.
>

-- 
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: having issues with dates and DAL

2016-07-20 Thread Niphlod


On Wednesday, July 20, 2016 at 9:35:44 PM UTC+2, web2py...@gmail.com wrote:
>
> Actually found out i was using the non datetime version of the date in the 
> database... Thanks all for the help.
>
> Secondary question. after i get this question i run a query with a 
> following code:
>
> query = db.table.id > 0
> if fruit:
> query &= db.table.fruit == fruit
>
> however, the database stores this variable as capital so "APPLE" but when 
> i put in "apple" the query returns nothing.. is there a way to resolve this?
>
>
>>
secondary answer: if your database stores fruit ALWAYS in uppercase, use 
db.table.fruit == fruit.upper() .
if instead you want to receive for db.table.fruit rows containing "apple", 
"Apple", "aPPle", "applE", and so on ... follow Dave's path, but be aware 
that for tables with lots of rows it'll be putting the backend under a lot 
of pressure . 
BTW, depending on the extent of the performances you want (and the oracle 
version), you MAY want to:
- normalize that field
- use executesql setting NLS_COMP 
- use executesql with REGEXP(fruit, 'apple', 'i')
- place an index
- etc etc etc

-- 
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: Want to add Confirmation on link in sqlform.grid

2016-07-20 Thread isi_jca
Hi!!!

In this manner, works the link:

links = [lambda row: A('Club call',_onclick="if(confirm('Do you want to 
club this call?')) document.location='%s'; return false;" % 
URL("","Incident",args=[row.id]))]

Regards.


El lunes, 13 de mayo de 2013, 9:11:10 (UTC-3), Pawan Jha escribió:
>
> not working frnd i have done changes as per you are given me its not 
> working
>
>
> On Mon, May 13, 2013 at 5:18 PM, Massimo Di Pierro  > wrote:
>
>> links = [lambda row: A('Club call',_onclick="if(confirm('Do you want to 
>> club this call')) document.location='%s'; return false;' % URL("","
>> Incident",args=[row.id])]
>>
>> On Monday, 13 May 2013 00:56:27 UTC-5, Pawan Jha wrote:
>>>
>>> Hi all 
>>>
>>> I am using this in SQLFORM.grid 
>>>
>>> here is confirm message but on clicking this Message is coming but when 
>>> i am clicking on no the its refresh the pages 
>>>
>>> so please tell me how will i prevent this 
>>>
>>>  links = [lambda row: A('Club call',_onclick="confirm('Do you want to 
>>> club this call')",_href=URL("","Incident",args=[row.id]))]
>>>
>> -- 
>>  
>> --- 
>> 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/groups/opt_out.
>>  
>>  
>>
>
>
>
> -- 
>
>
>
> *   Thanks  &  RegardsPawan Kr. 
> Pankaj91-9968831967/9540773888**Software 
> Engineer (DOT .Net)*
>  pawan.p an...@agnicient.com 
>
>

-- 
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: Want to add Confirmation on link in sqlform.grid

2016-07-20 Thread isi_jca


El lunes, 13 de mayo de 2013, 2:56:27 (UTC-3), Pawan Jha escribió:
>
> Hi all 
>
> I am using this in SQLFORM.grid 
>
> here is confirm message but on clicking this Message is coming but when i 
> am clicking on no the its refresh the pages 
>
> so please tell me how will i prevent this 
>
>  links = [lambda row: A('Club call',_onclick="confirm('Do you want to club 
> this call')",_href=URL("","Incident",args=[row.id]))]
>

-- 
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] Gerar menu com base em filtro.

2016-07-20 Thread leonardoporto
Boa tarde amigos!
Tenho o seguinte ambiente: a tabela padrão auth_user, com um campo city 
adicional que é uma referência da tabela City e uma tabela Businessman.

City possui 1 ou * Businessman
Ask possui 1 ou 0 Businessman.

Quando o usuário se cadastra ele escolhe sua cidade, e para postar alguma 
pergunta a escolhida cidade será sempre associada, ela sera usado como 
filtro, pra que ele possa fazer uma pergunta direcionada a um empresário da 
sua cidade ou até pra nenhum deles, que seria uma pergunta livre para 
qualquer empresário da responder.

Estou usando a seguinte instrução para setar o id da cidade no Modelo de 
Pergunta, e o id é setado no campo.

Field('city', 'string', label = 'City', readable=False, writable=False, 
default=auth.user.city),

Preciso que ao invés do ID, aparecesse o nome da cidade, e o principal: Que 
um submenu, fosse gerado com os Empresários daquela cidade, então um 
empresário fosse selecionado para enviar esta pergunta.
No momento não criei views, estou só no modelo de dados e usando o 
appadmin. Por isso não postei nenhum cod. de controller.
Muito obrigado galera!

-- 
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: having issues with dates and DAL

2016-07-20 Thread Dave S


On Wednesday, July 20, 2016 at 12:35:44 PM UTC-7, web2py...@gmail.com wrote:
>
> Actually found out i was using the non datetime version of the date in the 
> database... Thanks all for the help.
>
> Secondary question. after i get this question i run a query with a 
> following code:
>
> query = db.table.id > 0
> if fruit:
> query &= db.table.fruit == fruit
>
> however, the database stores this variable as capital so "APPLE" but when 
> i put in "apple" the query returns nothing.. is there a way to resolve this?
>
>
>
You may want to use the contains and/or like operator (equivalent to SQL's 
LIKE) which can be made case-insensitive.   Using the equality operator (==) 
is the strictest comparison you can use for this.

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#like--ilike--regexp--startswith--endswith--contains--upper--lower>
 
/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.


Re: [web2py] Re: Remove _extra from as_list()

2016-07-20 Thread Eric Christiaanse
Hi Anthony,

I'm not including them. I'm only using with_alias() and the select in
combination with as_list(). I would not expect to get the _extra as a
little bonus when you use with_alias()...

That's why I'm asking :)

Greetings,

Eric


2016-07-20 20:56 GMT+02:00 Anthony :

> The "_extra" dictionary stores values generated from expressions (rather
> than raw values from individual fields). If you don't want them to appear
> in the conversion of the Rows to a list of dictionaries, then don't include
> them in the original .select() call that generated the Rows object.
>
> Anthony
>
> On Wednesday, July 20, 2016 at 10:00:57 AM UTC-4, Eric wrote:
>>
>> Hi There,
>>
>> Is there a way in Web2Py to suppress the _extra information when
>> selecting data with as_list() or as_dict()?
>>
>> I can't find it and option for it, but maybe I'm just overlooking it in
>> the documentation ;)
>>
>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/d3YmI1e3iaQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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: having issues with dates and DAL

2016-07-20 Thread web2pyuser777
Actually found out i was using the non datetime version of the date in the 
database... Thanks all for the help.

Secondary question. after i get this question i run a query with a 
following code:

query = db.table.id > 0
if fruit:
query &= db.table.fruit == fruit

however, the database stores this variable as capital so "APPLE" but when i 
put in "apple" the query returns nothing.. is there a way to resolve this?


On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com wrote:
>
> Hi everyone,
>
> i keep getting this error:
>
> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
> parse_date
> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
> ValueError: invalid literal for int() with base 10: '2016/04/12'
>
>
> im basically submitting the form and searching a database for information 
> between certain dates using DAL with a table. the table/date format is 
> summarized as follows:
>
> import datetime
>
> today = datetime.datetime.today()
>
> yesterday = today.date() - datetime.timedelta(days=1)
>
> db = DAL(oracle:...)
>
> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>Field('enddt', type = 'date' , default = today, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>..)
>
>
> Im thinking it doesn't like the database has the format but not 100%. 
>
>
> thank you
>
>
>
>
>
>

-- 
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: Remove _extra from as_list()

2016-07-20 Thread Anthony
The "_extra" dictionary stores values generated from expressions (rather 
than raw values from individual fields). If you don't want them to appear 
in the conversion of the Rows to a list of dictionaries, then don't include 
them in the original .select() call that generated the Rows object.

Anthony

On Wednesday, July 20, 2016 at 10:00:57 AM UTC-4, Eric wrote:
>
> Hi There,
>
> Is there a way in Web2Py to suppress the _extra information when selecting 
> data with as_list() or as_dict()?
>
> I can't find it and option for it, but maybe I'm just overlooking it in 
> the documentation ;)
>
> 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: having issues with dates and DAL

2016-07-20 Thread Niphlod
nope, oracle stores DATE. differencing itself from other backends, it's 
your client that translates that date to a string representation. and pydal 
does (or it should) too.

That's what, 
theoretically, 
https://github.com/web2py/pydal/blob/master/pydal/adapters/oracle.py#L28 
and following do: "whenever you transmit a date back to me, please do in 
the following format". it then parses that string to a python date object, 
that is then serialized by python TO the format specified in the 
requires=IS_DATE() bit.

When you insert, it's the same process reversed: a form is ingested, the 
string is parsed to a datetime python object according to the 
requires=IS_DATE() format, the python date object is expanded to the format 
that session of oracle expects, and it is stored as DATE.

On Wednesday, July 20, 2016 at 5:44:17 PM UTC+2, web2py...@gmail.com wrote:
>
> I'm not sure what you mean... Oracle stores the date type using "/" 
> instead of "-" or ".".. i looked into the code for the parsing that web2py 
> uses and it only parses with "+" "-" or "." so that is why i think my issue 
> is arising. I was wondering if anyone knows an intermediary step i can take 
> to avoid this issue or maybe a style change i can make...
>
> On Wednesday, July 20, 2016 at 11:35:31 AM UTC-4, Niphlod wrote:
>>
>> are the actual fields in the oracle backend a "DATE" field ? if so, pydal 
>> NEEDS to parse it correctly, no matter the format you want to display it.
>>
>> On Wednesday, July 20, 2016 at 5:06:06 PM UTC+2, web2py...@gmail.com 
>> wrote:
>>>
>>> What i've found is that the oracle has the date stored at 2016/04/12 and 
>>> when the parse occurs, it looks for a - to seperate and cant find it. This 
>>> is why it states that its not an integer because the "/" are included in 
>>> the term... is there a way to parse with "/" instead of "-"? i know SQL 
>>> stores date in the -MM-DD format so thats why its not an issue there, 
>>> but im not quite sure what to do with oracle and setting the field to 
>>> "date".
>>>
>>> On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com 
>>> wrote:

 Hi everyone,

 i keep getting this error:

 File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
 parse_date
 (y, m, d) = map(int, str(value)[:10].strip().split('-'))
 ValueError: invalid literal for int() with base 10: '2016/04/12'


 im basically submitting the form and searching a database for information 
 between certain dates using DAL with a table. the table/date format is 
 summarized as follows:

 import datetime

 today = datetime.datetime.today()

 yesterday = today.date() - datetime.timedelta(days=1)

 db = DAL(oracle:...)

 db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
 requires IS_DATE(format('%Y/%M/%D))),

Field('enddt', type = 'date' , default = today, 
 requires IS_DATE(format('%Y/%M/%D))),

..)


 Im thinking it doesn't like the database has the format but not 100%. 


 thank you







-- 
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: How active and 'professional' is web2py?

2016-07-20 Thread Richard Vézina
web2py is really good framework and you won't find any other with a
learning curve as smooth as that...

There is not seems that many major web site build over web2py, though I
know for sure that there is many data centric app lying around in LAN of
multiples business.

Forces of web2py are :

It easses of use
Being fullstack framework (battery included)
Growth with you and your developping skills increase
Reactive community
Python

Cons
Disregarded by the purist :D

Richard


On Wed, Jul 20, 2016 at 10:51 AM, Carlos Zenteno 
wrote:

> It is not a "professional" product but check Sahara Eden.  It is based in
> web2py, it has a framework S3 built on top of web2py and it is used in
> critical disaster operation when the app is put to the test at its maximum
> performance...
>
> I wonder if I should use Linux, it is really old and won prices many years
> ago...
>
> --
> 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: having issues with dates and DAL

2016-07-20 Thread web2pyuser777
I'm not sure what you mean... Oracle stores the date type using "/" instead 
of "-" or ".".. i looked into the code for the parsing that web2py uses and 
it only parses with "+" "-" or "." so that is why i think my issue is 
arising. I was wondering if anyone knows an intermediary step i can take to 
avoid this issue or maybe a style change i can make...

On Wednesday, July 20, 2016 at 11:35:31 AM UTC-4, Niphlod wrote:
>
> are the actual fields in the oracle backend a "DATE" field ? if so, pydal 
> NEEDS to parse it correctly, no matter the format you want to display it.
>
> On Wednesday, July 20, 2016 at 5:06:06 PM UTC+2, web2py...@gmail.com 
> wrote:
>>
>> What i've found is that the oracle has the date stored at 2016/04/12 and 
>> when the parse occurs, it looks for a - to seperate and cant find it. This 
>> is why it states that its not an integer because the "/" are included in 
>> the term... is there a way to parse with "/" instead of "-"? i know SQL 
>> stores date in the -MM-DD format so thats why its not an issue there, 
>> but im not quite sure what to do with oracle and setting the field to 
>> "date".
>>
>> On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com wrote:
>>>
>>> Hi everyone,
>>>
>>> i keep getting this error:
>>>
>>> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
>>> parse_date
>>> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
>>> ValueError: invalid literal for int() with base 10: '2016/04/12'
>>>
>>>
>>> im basically submitting the form and searching a database for information 
>>> between certain dates using DAL with a table. the table/date format is 
>>> summarized as follows:
>>>
>>> import datetime
>>>
>>> today = datetime.datetime.today()
>>>
>>> yesterday = today.date() - datetime.timedelta(days=1)
>>>
>>> db = DAL(oracle:...)
>>>
>>> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
>>> requires IS_DATE(format('%Y/%M/%D))),
>>>
>>>Field('enddt', type = 'date' , default = today, 
>>> requires IS_DATE(format('%Y/%M/%D))),
>>>
>>>..)
>>>
>>>
>>> Im thinking it doesn't like the database has the format but not 100%. 
>>>
>>>
>>> thank you
>>>
>>>
>>>
>>>
>>>
>>>

-- 
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: UWSGI root vs limited user.

2016-07-20 Thread Niphlod
ah, ok!!! me, I'm proud of myself very little these days

but, and it's a big butI'm totally proud of you!

On Wednesday, July 20, 2016 at 4:39:39 PM UTC+2, Michael Messmer wrote:
>
> I figured out my own problem.  ;)  Another admin didn't have to save me. 
>  And i learned a new (to me) tool 'strace' to help myself.
>
>
>
>
> On Wed, Jul 20, 2016 at 7:21 AM, Niphlod > 
> wrote:
>
>> me, proud? of ?
>>
>> On Wednesday, July 20, 2016 at 8:02:55 AM UTC+2, Michael M wrote:
>>>
>>> Figured it out:
>>>
>>> Niplod you may be proud.  I ran strace in the service:
>>>
>>> [Unit]
>>> Description=uWSGI Emperor Service
>>> After=syslog.target
>>>
>>> [Service]
>>> EnvironmentFile=-/etc/sysconfig/uwsgi
>>> ExecStartPre=/bin/mkdir -p /run/uwsgi
>>> ExecStartPre=/bin/chown uwsgi:uwsgi /run/uwsgi
>>> ExecStart=/bin/strace -o /tmp/uwsgi.service /usr/sbin/uwsgi --ini 
>>> /etc/uwsgi.ini
>>> ExecReload=/bin/kill -HUP $MAINPID
>>> KillSignal=SIGINT
>>> Restart=always
>>> Type=notify
>>> StandardError=syslog
>>> NotifyAccess=all
>>>
>>> [Install]
>>> WantedBy=multi-user.target
>>>
>>>
>>>
>>> ---
>>> Which exposed this as i trolled through tons to find some keywords pop 
>>> out at:
>>>
>>> cat /tmp/uwsgi.service |wc -l
>>> 15031
>>>
>>> cat /tmp/uwsgi.service |grep "Permission denied"
>>> openat(AT_FDCWD, "/opt/www-data/web2py/site-packages", 
>>> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission 
>>> denied)
>>> openat(AT_FDCWD, "/opt/www-data/web2py/gluon", 
>>> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission 
>>> denied)
>>> open("/opt/www-data/web2py/VERSION", O_RDONLY) = -1 EACCES (Permission 
>>> denied)
>>>
>>> so i: 
>>> chmod u+r /opt/www-data/web2py/VERSION
>>> chmod u+r /opt/www-data/web2py/site-packages
>>> chmod u+r /opt/www-data/web2py/gluon
>>>
>>> restarted ( systemctl restart uwsgi.service ) uwsgi
>>>
>>> Loaded perfectly.
>>>
>>> Web2py now running as limited user "uwsgi" and not root!!!WOOHOO
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Monday, July 18, 2016 at 4:44:57 PM UTC-7, Michael Messmer wrote:

 Environment
 nginx & uwsgi
 Rhel7
 web2py: Version 2.14.6-stable+timestamp.2016.05.09.19.18.48
 (Running on Unknown, Python 2.7.5)

 ---
 uwsgi.ini file
 ---
 [uwsgi]
 master = true
 processes = 4
 max-requests = 50

 enable-threads = true

 chdir  = /opt/www-data/web2py
 module = wsgihandler:application

 plugin = python
 logto  = /var/log/nginx/uwsgi.log

 #gid = uwsgi
 #uid = uwsgi 

 socket = /run/uwsgi/web2py.sock
 chown-socket = uwsgi:nginx
 chmod-socket = 666
 vacuum = true







 ---
 running as root user & working
 ---

 *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:38:43 2016] ***
 compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January 
 2016 19:52:54
 os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
 nodename: n01
 machine: x86_64
 clock source: unix
 pcre jit disabled
 detected number of CPU cores: 8
 current working directory: /
 detected binary path: /usr/sbin/uwsgi
 chdir() to /opt/www-data/web2py
 your processes number limit is 63467
 your memory page size is 4096 bytes
 detected max file descriptor number: 1024
 lock engine: pthread robust mutexes
 thunder lock: disabled (you can enable it with --thunder-lock)
 uwsgi socket 0 bound to UNIX address /run/uwsgi/web2py.sock fd 4
 uWSGI running as root, you can use --uid/--gid/--chroot options
 *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
 Python version: 2.7.5 (default, Oct 11 2015, 17:47:16)  [GCC 4.8.3 
 20140911 (Red Hat 4.8.3-9)]
 Python main interpreter initialized at 0xaa8ec0
 python threads support enabled
 your server socket listen backlog is limited to 100 connections
 your mercy for graceful operations on workers is 60 seconds
 mapped 363840 bytes (355 KB) for 4 cores
 *** Operational MODE: preforking ***
 WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaa8ec0 
 pid: 7140 (default app)
 *** uWSGI is running in multiple interpreter mode ***
 spawned uWSGI master process (pid: 7140)
 spawned uWSGI worker 1 (pid: 7154, cores: 1)
 spawned uWSGI worker 2 (pid: 7155, cores: 1)
 spawned uWSGI worker 3 (pid: 7156, cores: 1)
 spawned uWSGI worker 4 (pid: 7157, cores: 1)




 
 running as uwsgi user & not working
 

 *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:31:51 2016] ***
 compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January 
 2016 19:52:54
 os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
 nodename: n01
 machine: x86_64
 clock source: unix
 pcre jit disabled

[web2py] Re: having issues with dates and DAL

2016-07-20 Thread Niphlod
are the actual fields in the oracle backend a "DATE" field ? if so, pydal 
NEEDS to parse it correctly, no matter the format you want to display it.

On Wednesday, July 20, 2016 at 5:06:06 PM UTC+2, web2py...@gmail.com wrote:
>
> What i've found is that the oracle has the date stored at 2016/04/12 and 
> when the parse occurs, it looks for a - to seperate and cant find it. This 
> is why it states that its not an integer because the "/" are included in 
> the term... is there a way to parse with "/" instead of "-"? i know SQL 
> stores date in the -MM-DD format so thats why its not an issue there, 
> but im not quite sure what to do with oracle and setting the field to 
> "date".
>
> On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com wrote:
>>
>> Hi everyone,
>>
>> i keep getting this error:
>>
>> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
>> parse_date
>> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
>> ValueError: invalid literal for int() with base 10: '2016/04/12'
>>
>>
>> im basically submitting the form and searching a database for information 
>> between certain dates using DAL with a table. the table/date format is 
>> summarized as follows:
>>
>> import datetime
>>
>> today = datetime.datetime.today()
>>
>> yesterday = today.date() - datetime.timedelta(days=1)
>>
>> db = DAL(oracle:...)
>>
>> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>>Field('enddt', type = 'date' , default = today, 
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>>..)
>>
>>
>> Im thinking it doesn't like the database has the format but not 100%. 
>>
>>
>> thank you
>>
>>
>>
>>
>>
>>

-- 
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: having issues with dates and DAL

2016-07-20 Thread web2pyuser777
What i've found is that the oracle has the date stored at 2016/04/12 and 
when the parse occurs, it looks for a - to seperate and cant find it. This 
is why it states that its not an integer because the "/" are included in 
the term... is there a way to parse with "/" instead of "-"? i know SQL 
stores date in the -MM-DD format so thats why its not an issue there, 
but im not quite sure what to do with oracle and setting the field to 
"date".

On Tuesday, July 19, 2016 at 3:54:10 PM UTC-4, web2py...@gmail.com wrote:
>
> Hi everyone,
>
> i keep getting this error:
>
> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
> parse_date
> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
> ValueError: invalid literal for int() with base 10: '2016/04/12'
>
>
> im basically submitting the form and searching a database for information 
> between certain dates using DAL with a table. the table/date format is 
> summarized as follows:
>
> import datetime
>
> today = datetime.datetime.today()
>
> yesterday = today.date() - datetime.timedelta(days=1)
>
> db = DAL(oracle:...)
>
> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>Field('enddt', type = 'date' , default = today, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>..)
>
>
> Im thinking it doesn't like the database has the format but not 100%. 
>
>
> thank you
>
>
>
>
>
>

-- 
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 active and 'professional' is web2py?

2016-07-20 Thread Carlos Zenteno
It is not a "professional" product but check Sahara Eden.  It is based in 
web2py, it has a framework S3 built on top of web2py and it is used in critical 
disaster operation when the app is put to the test at its maximum performance...

I wonder if I should use Linux, it is really old and won prices many years 
ago...

-- 
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 active and 'professional' is web2py?

2016-07-20 Thread Carlos Zenteno
It is not a "professional" product but check Sahara Eden.  It is based in 
web2py, it has a framework S3 built on top of web2py and it is used in critical 
disaster operation when the app is put to the test at its maximum performance...

I wonder if I should use Linux, it is really old and won prices many years 
ago...

-- 
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: UWSGI root vs limited user.

2016-07-20 Thread Michael Messmer
I figured out my own problem.  ;)  Another admin didn't have to save me.




Regards,

*Michael B. Messmer*
*UNIX OS Team - Analyst*
Desk: (425) 416-8871



On Wed, Jul 20, 2016 at 7:21 AM, Niphlod  wrote:

> me, proud? of ?
>
> On Wednesday, July 20, 2016 at 8:02:55 AM UTC+2, Michael M wrote:
>>
>> Figured it out:
>>
>> Niplod you may be proud.  I ran strace in the service:
>>
>> [Unit]
>> Description=uWSGI Emperor Service
>> After=syslog.target
>>
>> [Service]
>> EnvironmentFile=-/etc/sysconfig/uwsgi
>> ExecStartPre=/bin/mkdir -p /run/uwsgi
>> ExecStartPre=/bin/chown uwsgi:uwsgi /run/uwsgi
>> ExecStart=/bin/strace -o /tmp/uwsgi.service /usr/sbin/uwsgi --ini
>> /etc/uwsgi.ini
>> ExecReload=/bin/kill -HUP $MAINPID
>> KillSignal=SIGINT
>> Restart=always
>> Type=notify
>> StandardError=syslog
>> NotifyAccess=all
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>>
>> ---
>> Which exposed this as i trolled through tons to find some keywords pop
>> out at:
>>
>> cat /tmp/uwsgi.service |wc -l
>> 15031
>>
>> cat /tmp/uwsgi.service |grep "Permission denied"
>> openat(AT_FDCWD, "/opt/www-data/web2py/site-packages",
>> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied
>> )
>> openat(AT_FDCWD, "/opt/www-data/web2py/gluon",
>> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied
>> )
>> open("/opt/www-data/web2py/VERSION", O_RDONLY) = -1 EACCES (Permission
>> denied)
>>
>> so i:
>> chmod u+r /opt/www-data/web2py/VERSION
>> chmod u+r /opt/www-data/web2py/site-packages
>> chmod u+r /opt/www-data/web2py/gluon
>>
>> restarted ( systemctl restart uwsgi.service ) uwsgi
>>
>> Loaded perfectly.
>>
>> Web2py now running as limited user "uwsgi" and not root!!!WOOHOO
>>
>>
>>
>>
>>
>>
>> On Monday, July 18, 2016 at 4:44:57 PM UTC-7, Michael Messmer wrote:
>>>
>>> Environment
>>> nginx & uwsgi
>>> Rhel7
>>> web2py: Version 2.14.6-stable+timestamp.2016.05.09.19.18.48
>>> (Running on Unknown, Python 2.7.5)
>>>
>>> ---
>>> uwsgi.ini file
>>> ---
>>> [uwsgi]
>>> master = true
>>> processes = 4
>>> max-requests = 50
>>>
>>> enable-threads = true
>>>
>>> chdir  = /opt/www-data/web2py
>>> module = wsgihandler:application
>>>
>>> plugin = python
>>> logto  = /var/log/nginx/uwsgi.log
>>>
>>> #gid = uwsgi
>>> #uid = uwsgi
>>>
>>> socket = /run/uwsgi/web2py.sock
>>> chown-socket = uwsgi:nginx
>>> chmod-socket = 666
>>> vacuum = true
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---
>>> running as root user & working
>>> ---
>>>
>>> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:38:43 2016] ***
>>> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January
>>> 2016 19:52:54
>>> os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
>>> nodename: n01
>>> machine: x86_64
>>> clock source: unix
>>> pcre jit disabled
>>> detected number of CPU cores: 8
>>> current working directory: /
>>> detected binary path: /usr/sbin/uwsgi
>>> chdir() to /opt/www-data/web2py
>>> your processes number limit is 63467
>>> your memory page size is 4096 bytes
>>> detected max file descriptor number: 1024
>>> lock engine: pthread robust mutexes
>>> thunder lock: disabled (you can enable it with --thunder-lock)
>>> uwsgi socket 0 bound to UNIX address /run/uwsgi/web2py.sock fd 4
>>> uWSGI running as root, you can use --uid/--gid/--chroot options
>>> *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
>>> Python version: 2.7.5 (default, Oct 11 2015, 17:47:16)  [GCC 4.8.3
>>> 20140911 (Red Hat 4.8.3-9)]
>>> Python main interpreter initialized at 0xaa8ec0
>>> python threads support enabled
>>> your server socket listen backlog is limited to 100 connections
>>> your mercy for graceful operations on workers is 60 seconds
>>> mapped 363840 bytes (355 KB) for 4 cores
>>> *** Operational MODE: preforking ***
>>> WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaa8ec0
>>> pid: 7140 (default app)
>>> *** uWSGI is running in multiple interpreter mode ***
>>> spawned uWSGI master process (pid: 7140)
>>> spawned uWSGI worker 1 (pid: 7154, cores: 1)
>>> spawned uWSGI worker 2 (pid: 7155, cores: 1)
>>> spawned uWSGI worker 3 (pid: 7156, cores: 1)
>>> spawned uWSGI worker 4 (pid: 7157, cores: 1)
>>>
>>>
>>>
>>>
>>> 
>>> running as uwsgi user & not working
>>> 
>>>
>>> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:31:51 2016] ***
>>> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January
>>> 2016 19:52:54
>>> os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
>>> nodename: n01
>>> machine: x86_64
>>> clock source: unix
>>> pcre jit disabled
>>> detected number of CPU cores: 8
>>> current working directory: /
>>> detected binary path: /usr/sbin/uwsgi
>>> chdir() to /opt/www-data/web2py
>>> your processes number limit is 63467
>>> your memory page size is 4096 bytes
>>> detected max file descriptor number: 1024
>>> lock engine: pthread robust mutexes
>>> thunder lock: disabled (you can ena

Re: [web2py] web2py on android

2016-07-20 Thread Carlos Cesar Caballero Díaz
Hi Paolo, in my experience with Android, do what this article describes 
is a really bad idea, the resources usage is very important in tablets 
and smartphones because of the little batteries they have, include a 
complete http server running inside an app will drain the battery 
considerably fast.


Greetings.

El 19/07/16 a las 07:16, Paolo Amboni escribió:

Is it possible to do something like that with web2py?


  Android apps with Python, Flask and a WebView
  


(https://kivy.org/planet/2016/05/android-apps-with-python-flask-and-a-webview/)

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.




--
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: UWSGI root vs limited user.

2016-07-20 Thread Niphlod
me, proud? of ?

On Wednesday, July 20, 2016 at 8:02:55 AM UTC+2, Michael M wrote:
>
> Figured it out:
>
> Niplod you may be proud.  I ran strace in the service:
>
> [Unit]
> Description=uWSGI Emperor Service
> After=syslog.target
>
> [Service]
> EnvironmentFile=-/etc/sysconfig/uwsgi
> ExecStartPre=/bin/mkdir -p /run/uwsgi
> ExecStartPre=/bin/chown uwsgi:uwsgi /run/uwsgi
> ExecStart=/bin/strace -o /tmp/uwsgi.service /usr/sbin/uwsgi --ini 
> /etc/uwsgi.ini
> ExecReload=/bin/kill -HUP $MAINPID
> KillSignal=SIGINT
> Restart=always
> Type=notify
> StandardError=syslog
> NotifyAccess=all
>
> [Install]
> WantedBy=multi-user.target
>
>
>
> ---
> Which exposed this as i trolled through tons to find some keywords pop out 
> at:
>
> cat /tmp/uwsgi.service |wc -l
> 15031
>
> cat /tmp/uwsgi.service |grep "Permission denied"
> openat(AT_FDCWD, "/opt/www-data/web2py/site-packages", 
> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
> openat(AT_FDCWD, "/opt/www-data/web2py/gluon", 
> O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 EACCES (Permission denied)
> open("/opt/www-data/web2py/VERSION", O_RDONLY) = -1 EACCES (Permission 
> denied)
>
> so i: 
> chmod u+r /opt/www-data/web2py/VERSION
> chmod u+r /opt/www-data/web2py/site-packages
> chmod u+r /opt/www-data/web2py/gluon
>
> restarted ( systemctl restart uwsgi.service ) uwsgi
>
> Loaded perfectly.
>
> Web2py now running as limited user "uwsgi" and not root!!!WOOHOO
>
>
>
>
>
>
> On Monday, July 18, 2016 at 4:44:57 PM UTC-7, Michael Messmer wrote:
>>
>> Environment
>> nginx & uwsgi
>> Rhel7
>> web2py: Version 2.14.6-stable+timestamp.2016.05.09.19.18.48
>> (Running on Unknown, Python 2.7.5)
>>
>> ---
>> uwsgi.ini file
>> ---
>> [uwsgi]
>> master = true
>> processes = 4
>> max-requests = 50
>>
>> enable-threads = true
>>
>> chdir  = /opt/www-data/web2py
>> module = wsgihandler:application
>>
>> plugin = python
>> logto  = /var/log/nginx/uwsgi.log
>>
>> #gid = uwsgi
>> #uid = uwsgi 
>>
>> socket = /run/uwsgi/web2py.sock
>> chown-socket = uwsgi:nginx
>> chmod-socket = 666
>> vacuum = true
>>
>>
>>
>>
>>
>>
>>
>> ---
>> running as root user & working
>> ---
>>
>> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:38:43 2016] ***
>> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January 
>> 2016 19:52:54
>> os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
>> nodename: n01
>> machine: x86_64
>> clock source: unix
>> pcre jit disabled
>> detected number of CPU cores: 8
>> current working directory: /
>> detected binary path: /usr/sbin/uwsgi
>> chdir() to /opt/www-data/web2py
>> your processes number limit is 63467
>> your memory page size is 4096 bytes
>> detected max file descriptor number: 1024
>> lock engine: pthread robust mutexes
>> thunder lock: disabled (you can enable it with --thunder-lock)
>> uwsgi socket 0 bound to UNIX address /run/uwsgi/web2py.sock fd 4
>> uWSGI running as root, you can use --uid/--gid/--chroot options
>> *** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
>> Python version: 2.7.5 (default, Oct 11 2015, 17:47:16)  [GCC 4.8.3 
>> 20140911 (Red Hat 4.8.3-9)]
>> Python main interpreter initialized at 0xaa8ec0
>> python threads support enabled
>> your server socket listen backlog is limited to 100 connections
>> your mercy for graceful operations on workers is 60 seconds
>> mapped 363840 bytes (355 KB) for 4 cores
>> *** Operational MODE: preforking ***
>> WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xaa8ec0 
>> pid: 7140 (default app)
>> *** uWSGI is running in multiple interpreter mode ***
>> spawned uWSGI master process (pid: 7140)
>> spawned uWSGI worker 1 (pid: 7154, cores: 1)
>> spawned uWSGI worker 2 (pid: 7155, cores: 1)
>> spawned uWSGI worker 3 (pid: 7156, cores: 1)
>> spawned uWSGI worker 4 (pid: 7157, cores: 1)
>>
>>
>>
>>
>> 
>> running as uwsgi user & not working
>> 
>>
>> *** Starting uWSGI 2.0.12 (64bit) on [Mon Jul 18 16:31:51 2016] ***
>> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-4) on 02 January 
>> 2016 19:52:54
>> os: Linux-3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016
>> nodename: n01
>> machine: x86_64
>> clock source: unix
>> pcre jit disabled
>> detected number of CPU cores: 8
>> current working directory: /
>> detected binary path: /usr/sbin/uwsgi
>> chdir() to /opt/www-data/web2py
>> your processes number limit is 63467
>> your memory page size is 4096 bytes
>> detected max file descriptor number: 1024
>> lock engine: pthread robust mutexes
>> thunder lock: disabled (you can enable it with --thunder-lock)
>> uwsgi socket 0 bound to UNIX address /run/uwsgi/web2py.sock fd 4
>> setgid() to 168
>> set additional group 169 (nginx)
>> setuid() to 168
>> Python version: 2.7.5 (default, Oct 11 2015, 17:47:16)  [GCC 4.8.3 
>> 20140911 (Red Hat 4.8.3-9)]
>> Python main interpreter initialized at 0x1692ef0
>> python threads support enabled
>> your ser

[web2py] Re: having issues with dates and DAL

2016-07-20 Thread Niphlod
nope... don't go the wrong way. web2py/pydal stores dates and datetimes to 
native types, with the correct format in the database. 
Upon insertion and retrieval, it uses the format to translate the native 
type to the string representation the app wants. 

tl;dr : format is just for representation, not for storage. If it works 
with postgresql or sqlite, it NEEDS to work with oracle, too.



On Wednesday, July 20, 2016 at 3:54:19 PM UTC+2, Marlysson Silva wrote:
>
> Try something how:
>
> . IS_DATE(format('%Y-%M-%D) .
>
>
> Seeing source code web2py, the split is made at "-" .. maybe this be the 
> error.
>
>
> Em terça-feira, 19 de julho de 2016 16:54:10 UTC-3, web2py...@gmail.com 
> escreveu:
>>
>> Hi everyone,
>>
>> i keep getting this error:
>>
>> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
>> parse_date
>> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
>> ValueError: invalid literal for int() with base 10: '2016/04/12'
>>
>>
>> im basically submitting the form and searching a database for information 
>> between certain dates using DAL with a table. the table/date format is 
>> summarized as follows:
>>
>> import datetime
>>
>> today = datetime.datetime.today()
>>
>> yesterday = today.date() - datetime.timedelta(days=1)
>>
>> db = DAL(oracle:...)
>>
>> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>>Field('enddt', type = 'date' , default = today, 
>> requires IS_DATE(format('%Y/%M/%D))),
>>
>>..)
>>
>>
>> Im thinking it doesn't like the database has the format but not 100%. 
>>
>>
>> thank you
>>
>>
>>
>>
>>
>>

-- 
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: tootip in menu

2016-07-20 Thread Niphlod
^_^''' 

you can't create an attribute with a dash in python. if you want to use 
data, either use the ** notation (splatting a pre-built dictionary) or 
leverage the "special" data= argument that takes a dict (yep, you're not 
the only one using data- attributes...)


span_attrs = {'_data-placement' : 'top', '_data-toggle' : 'tooltip'}
SPAN('hello', **span_attrs)

OR

SPAN('hello', data=dict(placement='top', toggle='tooltip'))

On Wednesday, July 20, 2016 at 11:48:24 AM UTC+2, Annet wrote:
>
> I have the following menu:
>
> response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
> _target="_blank")), False, URL())]
>
> I want to add a Bootstrap tooltip to the button, I tried:
>
> response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
> _target="_blank", _data-placement="top",  _data-toggle="tooltip", 
> _title="Business base and nxt")), False, URL())]
>
>
> but this results in a 
>
> SyntaxError("keyword can't be an expression", ())
>
> Is there a way to add a tooltip to a menu item?
>
> KInd regards,
>
> Annet
>
>

-- 
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] Remove _extra from as_list()

2016-07-20 Thread Eric
Hi There,

Is there a way in Web2Py to suppress the _extra information when selecting 
data with as_list() or as_dict()?

I can't find it and option for it, but maybe I'm just overlooking it in the 
documentation ;)

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: having issues with dates and DAL

2016-07-20 Thread Marlysson Silva
Try something how:

. IS_DATE(format('%Y-%M-%D) .


Seeing source code web2py, the split is made at "-" .. maybe this be the error.


Em terça-feira, 19 de julho de 2016 16:54:10 UTC-3, web2py...@gmail.com 
escreveu:
>
> Hi everyone,
>
> i keep getting this error:
>
> File "/web2py/gluon/packages/dal/pydal/adapters/base.py", line 1544, in 
> parse_date
> (y, m, d) = map(int, str(value)[:10].strip().split('-'))
> ValueError: invalid literal for int() with base 10: '2016/04/12'
>
>
> im basically submitting the form and searching a database for information 
> between certain dates using DAL with a table. the table/date format is 
> summarized as follows:
>
> import datetime
>
> today = datetime.datetime.today()
>
> yesterday = today.date() - datetime.timedelta(days=1)
>
> db = DAL(oracle:...)
>
> db.table('name', Field('startdt' , type = 'date' , default = yesterday, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>Field('enddt', type = 'date' , default = today, 
> requires IS_DATE(format('%Y/%M/%D))),
>
>..)
>
>
> Im thinking it doesn't like the database has the format but not 100%. 
>
>
> thank you
>
>
>
>
>
>

-- 
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: Best way to send data from web2py client to web2py server

2016-07-20 Thread Marlysson Silva
Using forms?
And web2py get them using request.vars.*

Em quarta-feira, 20 de julho de 2016 09:59:18 UTC-3, Aydin escreveu:
>
> What's the best way to send data from web2py clients to a web2py server? 
> Especially when there are many web2py clients that at the same time send 
> data to the web2py server? Thanks for the help
>

-- 
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] Best way to send data from web2py client to web2py server

2016-07-20 Thread Aydin
What's the best way to send data from web2py clients to a web2py server? 
Especially when there are many web2py clients that at the same time send 
data to the web2py server? Thanks for the help

-- 
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_in_db() contains query not work for list:reference type

2016-07-20 Thread Anthony
What do you mean by "not working"? Are you getting an error or some other 
unexpected behavior? Describe what is happening and what you expect instead?

Anthony

On Wednesday, July 20, 2016 at 3:54:18 AM UTC-4, 黄祥 wrote:
>
> let say i have code
> *models/db.py*
> db.define_table('employee', 
> Field('is_auth', 'boolean'),
> Field('auth_user', 'reference auth_user'), 
> Field('full_name'), 
> Field('role'), 
> format = '%(full_name)s')
>
> auth_user_employee = db(db.employee.auth_user == 
> auth.user_id).select().first()
>
> db.define_table('client', 
> Field('name'), 
> Field('pic_it', 'list:reference employee'), 
> format = '%(name)s')
>
> # work for text type
> db.client.pic_it.requires = IS_IN_DB(db(db.employee.role.contains('IT') ), 
> db.employee.id, db.employee._format, 
> multiple = True)
> db.define_table('checklist', 
> Field('checklist_no'), 
> Field('client', 'reference client'), 
> format = '%(checklist_no)s')
>
> *# not work for list:reference type*
> *db.checklist.client.requires = 
> IS_IN_DB(db(db.client.pic_it.contains(auth_user_employee.id 
> ) ), *
> * db.client.id , db.client._format)*
>
> why is_in_db() contains query not work for list:reference type?
> any idea to solve this?
>
> thanks and 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] tootip in menu

2016-07-20 Thread 'Annet' via web2py-users
I have the following menu:

response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
_target="_blank")), False, URL())]

I want to add a Bootstrap tooltip to the button, I tried:

response.app_menu = [(CAT(SPAN('Connect', _class="btn btn-default", 
_target="_blank", _data-placement="top",  _data-toggle="tooltip", 
_title="Business base and nxt")), False, URL())]


but this results in a 

SyntaxError("keyword can't be an expression", ())

Is there a way to add a tooltip to a menu item?

KInd regards,

Annet

-- 
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_in_db() contains query not work for list:reference type

2016-07-20 Thread 黄祥
let say i have code
*models/db.py*
db.define_table('employee', 
Field('is_auth', 'boolean'),
Field('auth_user', 'reference auth_user'), 
Field('full_name'), 
Field('role'), 
format = '%(full_name)s')

auth_user_employee = db(db.employee.auth_user == 
auth.user_id).select().first()

db.define_table('client', 
Field('name'), 
Field('pic_it', 'list:reference employee'), 
format = '%(name)s')

# work for text type
db.client.pic_it.requires = IS_IN_DB(db(db.employee.role.contains('IT') ), 
db.employee.id, db.employee._format, 
multiple = True)
db.define_table('checklist', 
Field('checklist_no'), 
Field('client', 'reference client'), 
format = '%(checklist_no)s')

*# not work for list:reference type*
*db.checklist.client.requires = 
IS_IN_DB(db(db.client.pic_it.contains(auth_user_employee.id) ), *
* db.client.id, db.client._format)*

why is_in_db() contains query not work for list:reference type?
any idea to solve this?

thanks and 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] custom register and verify_email

2016-07-20 Thread 'Annet' via web2py-users
I have this settings:

auth.settings.actions_disabled = ['register', 'impersonate', 'groups']
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False

and a custom register function in the default controller:


def register():
form = SQLFORM.factory(db.auth_user,
  Field('password_two', type='password',
requires = IS_EQUAL_TO(request.vars.password, 
error_message='passwords do not match')),
   db.auth_dummy)

if form.validate():
# amongst others insert user and dummy data
..

usercontext = dict()
usermessage = response.render('default/register_mail.html', 
usercontext)
usermail = mail.send(to=[recipient], subject='', message=[None, 
usermessage])

elif form.errors:
get_flash(response, None, 'danger', 'error')
elif not response.flash:
get_flash(response, None, 'info', 'default')

return dict(form=form)


What I want is to prevent web2py from sending the verification email and 
include the link

url = 'https://' + 
request.env.http_host+URL('default','user',args=['verify_email']) + '/'+ 
registration_key

in default/register_mail.html

When the user clicks the link I want the verification to take place but I 
also want to insert memberships etc.

What is the best way to code this staying as close to web2py's access 
control as possible?


Kind regards,

Annet




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