[web2py] Re: Is it possible for Web2Py SOAP-Services to give feedback during lenghty operations?

2016-10-24 Thread Oliver Holmes
Great! Will give the queued task a go. Not quite sure how to send the 
feedback over my SOAP pipeline though. But I'll come up with something.

Thanks and cheers!

Am Donnerstag, 20. Oktober 2016 19:44:12 UTC+2 schrieb Dave S:
>
>
>
> On Thursday, October 20, 2016 at 7:38:16 AM UTC-7, Oliver Holmes wrote:
>>
>> I am using Web2Py on a RaspberryPI as a SOAP service provider and a very 
>> rudimentary configuration is possible through some views. User interaction 
>> is via a client application and users are mostly unaware that there is some 
>> server running in one of their shelves. I have just recently implemented a 
>> procedure to update a server via the client. It stores the current 
>> web2py-app then exports the db as csv, updates any files that need 
>> updating, clears all tables and reimports the csv. This works fine, but may 
>> result in timeout messages on the client side, as tests have shown. 
>> Besides, for the user there is no way of knowing how far the procedure has 
>> gone, and how much longer the wait will be. Is there a possibility to give 
>> feedback to the client? Any kind of message would be great just numeric to 
>> fill a progress indicator or even text to display progress messages?
>>
>> Regards,
>> Oliver Holmes
>>
>
>
> Here's what I would do:  run the update as a queued task.  Have a 
> "progress" table in the db;  it only needs to be 1 row.  [Alternate idea; 
> store progress in a file in the filesystem; I don't think you can update 
> the session from the Scheduler environment, BICBW].  The page that starts 
> the update goes to a status page which displays the current progress value 
> and has refresh set to 10 seconds or such, or it has a javascript loop that 
> fires an AJAX request  off and sleeps for 10 seconds.
>
> There have been some progress bars discussed here, and that should be 
> searchable in the forum archives, but I think stupid.css (used in the 
> current Welcome app) has that built-in; check out Massiomo's examples at 
> https://github.com/mdipierro/stupid.css>. (about halfway down on the 
> examples page)
>
> /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: Graph Model (proposal to contribute)

2016-10-24 Thread Andrew Willimott


Has anyone else tried visualising the models with d3js ?  I have a mockup 
working using the force layout.  I'd suggest this is a better long term 
approach than relying on graphviz being installed.  (Graphviz has some good 
layouts though).

I can send cleaned up code as a candidate to add to Welcome.  





On Tuesday, February 19, 2013 at 4:33:41 AM UTC+13, Ramos wrote:
>
> D3js pure javascript on client!
>
> see this example of meteorjs using d3js
>
> http://meteor.com/examples/parties
>
> That is something...
>
>
>
> 2013/2/18 Niphlod >
>
>> the only issue with the current implementation in trunk is that on 
>> Windows it's almost impossible to get it going, due to the requirements.
>>
>>
>> -- 
>>  
>> --- 
>> 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.
>>  
>>  
>>
>
>

-- 
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: tasks hierarchy

2016-10-24 Thread Niphlod
you should use "Jobs" for that.

any task queued that needs another task to be executed before it should be 
linked with

thejob.add_deps(dependant, parent)

in your case:
- cat3 is dependant from cat2 
- cat2 is dependant from cat1

read more using the https://github.com/niphlod/w2p_scheduler_tests test app.

On Sunday, October 23, 2016 at 11:44:12 AM UTC+2, Pierre wrote:
>
> Hi,
>
> Suppose a batch of tasks of 3 categories such that *cat1 >  cat2 >  cat3*  
> and a group of sheduler's processes to perform these as soon as they are 
> queued.
>
> How do i instruct workers to pick cat1 tasks first and then cat2 tasks 
> (only if no cat1 task is present in the queue) and finally cat3 tasks (if 
> no cat1 & cat2 tasks are queued) ?
>

-- 
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: Randomly stuck web2py

2016-10-24 Thread Niphlod
see the log to trace any DDos attempts (or stuck requests )

On Friday, October 21, 2016 at 10:54:32 PM UTC+2, Wasim Baig wrote:
>
> Been using web2py for sometime now, thank you all for making life so easy.
>
> We use stock web2py src on debian 8, with Rocket and mysql and start them 
> in screen.
>
> Frequently my web2py process get stuck. Ctrl-C won't kill it, we end up 
> Ctrl-Z it, and then kill -9 pid.
>
> For example, 
>
> root 13387  0.8  0.4 1131328 156496 pts/63 Sl+  Oct18   7:12 python2.7 
> web2py.py -d /var/run/web2py_localhost_8000.pid -a XXX --interfaces=
> 127.0.0.1:8000 
> root 13421  0.0  0.4 1109424 143336 pts/8  Sl   Oct18   0:39 python2.7 
> web2py.py -d /var/run/web2py_8000.pid -a XXX 
> --interfaces=148.251.132.230:8000:/etc/ssl/private/batuni_pk.key:/etc/ssl/private/batuni_pk.crt
>  
> --ca-cert=/etc/ssl/private/AddTrustExternalCARoot.crt 
> --ca-cert=/etc/ssl/private/COMODORSAAddTrustCA.crt 
> --ca-cert=/etc/ssl/private/COMODORSADomainValidationSecureServerCA.crt 
> --ca-cert=/etc/ssl/private/batuni_pk.ca-bundle
>
>
> Of these two processes, the one on localhost continues to respond fine, 
> but the one on public IP was stuck.
> Nothing in the logs that I can see point to a problem. 
>
> What can I do to troubleshoot this?
>
> -wasim 
>

-- 
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: Grid export csv

2016-10-24 Thread Niphlod
never ever pull web2py AND pydal master's  and merge (unless you really 
know what you're doing). When using "master", at most, use web2py's one, 
which has the correct pointers to pydal's specific commits.

Any commit later than 15aug should work fine ^_^

On Friday, October 21, 2016 at 10:54:31 PM UTC+2, Bartosz Baranowski wrote:
>
> Niphlod,
>
> I am using latest web2py and pydal from master branches. Any idea where is 
> the fix? Could you please direct me to the commit?
>
> W dniu środa, 3 sierpnia 2016 12:51:56 UTC-7 użytkownik Niphlod napisał:
>>
>> should be already fixed on master, anyway if you're in a hurry, set 
>> entity_quoring=False on the DAL line to make it work again (long story 
>> short, DAL now quotes everything by default and not every cog in the wheel 
>> was expecting that)
>>
>> On Monday, August 1, 2016 at 1:51:54 PM UTC+2, Kostas M wrote:
>>>
>>> I have the same problem with the CSV, HTML, TSV export buttons. The 
>>> Ticket for the CSV is pasted below. The problem at least with the csv 
>>> export button seems to be with the REGEX_TABLE_DOT_FIELD. Normally, this 
>>> constant is defined in regex.py as:
>>>
>>> REGEX_TABLE_DOT_FIELD = re.compile('^(\w+)\.([^.]+)$')
>>>
>>> and previous web2py versions used it.
>>>
>>> However, now it takes the REGEX_TABLE_DOT_FIELD definition from the 
>>> base.py:
>>>
>>> obj.REGEX_TABLE_DOT_FIELD = re.compile(
>>> r'^' + quot % regex_ent + r'\.' + quot % regex_ent + r'$')
>>>
>>>
>>> which is a totally different regex and it doesn't match with the table 
>>> field names...
>>>
>>>
>>> Ticket ID 
>>>
>>> 127.0.0.1.2016-08-01.14-36-35.a05a56c8-5b22-42c3-a3e3-385322b5f0fe
>>>  Version 
>>> web2py™ Version 2.14.5-stable+timestamp.2016.04.14.03.26.16 
>>> Python Python 2.7.6: /home/kmouts/Envs/prolims2_venv/bin/python2.7 
>>> (prefix: /home/kmouts/Envs/prolims2_venv) Traceback 
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>> 16.
>>> 17.
>>> 18.
>>> 19.
>>> 20.
>>> 21.
>>> 22.
>>>
>>> Traceback (most recent call last):
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/restricted.py", 
>>> line 227, in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/kmouts/PycharmProjects/prolims2/web2py/applications/prolims2/controllers/muser.py"
>>>  , 
>>> line 187, in 
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/globals.py", 
>>> line 417, in 
>>> self._caller = lambda f: f()
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/tools.py", line 
>>> 4258, in f
>>> return action(*a, **b)
>>>   File 
>>> "/home/kmouts/PycharmProjects/prolims2/web2py/applications/prolims2/controllers/muser.py"
>>>  , 
>>> line 49, in my_analyses
>>> exportclasses=dict(csv_with_hidden_cols=False, 
>>> tsv_with_hidden_cols=False)
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/sqlhtml.py", 
>>> line 3102, in smartgrid
>>> user_signature=user_signature, **kwargs)
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/sqlhtml.py", 
>>> line 2473, in grid
>>> raise HTTP(200, oExp.export(), **response.headers)
>>>   File "/home/kmouts/PycharmProjects/prolims2/web2py/gluon/sqlhtml.py", 
>>> line 3514, in export
>>> self.rows.export_to_csv_file(s, represent=True)
>>>   File 
>>> "/home/kmouts/Envs/prolims2_venv/local/lib/python2.7/site-packages/pydal/objects.py",
>>>  line 2446, in export_to_csv_file
>>> row.append(record._extra[col])
>>>   File 
>>> "/home/kmouts/Envs/prolims2_venv/local/lib/python2.7/site-packages/pydal/objects.py",
>>>  line 91, in __getattr__
>>> raise AttributeError
>>> AttributeError
>>>
>>>
>>>

-- 
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] order by the greater of 2 fields

2016-10-24 Thread Anthony Smith
Hi all,

I have table with 2 fields, withhold _until_date and esi_withhold_until.

Is is it possible to order by so the the greater of the 2 fields was at the 
top of the list.

cheers 

Anthony  

-- 
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: order by the greater of 2 fields

2016-10-24 Thread 黄祥
pls try (not tested)
myorder = db.mytable.withhold_until_date | db.mytable.esi_withhold_until
db().select(db.mytable.ALL, orderby = myorder)

ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer

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] update_or_insert does not return id of record ?!

2016-10-24 Thread António Ramos
hello i noticed that
db.mytable.update_or_insert(...)
does not return the id of the record updated or created
Is this correct ? i would be nice to have it reurned

Regards
António

-- 
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: order by the greater of 2 fields

2016-10-24 Thread Anthony
On Monday, October 24, 2016 at 8:55:23 AM UTC-4, 黄祥 wrote:
>
> pls try (not tested)
> myorder = db.mytable.withhold_until_date | db.mytable.esi_withhold_until
> db().select(db.mytable.ALL, orderby = myorder)
>

That will order by withhold_until_date, with esi_withhold_until breaking 
any ties -- it will not order by the max of those two fields.

Anthony

-- 
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: order by the greater of 2 fields

2016-10-24 Thread Anthony
On Monday, October 24, 2016 at 7:11:29 AM UTC-4, Anthony Smith wrote:
>
> Hi all,
>
> I have table with 2 fields, withhold _until_date and esi_withhold_until.
>
> Is is it possible to order by so the the greater of the 2 fields was at 
> the top of the list.
>

I think there are various ways to achieve this in SQL, though not sure you 
could easily use the DAL to generate that SQL. Does you query involve a 
limitby or pagination (i.e., does the sorting have to be done by the 
database as part of the query)? If not, you could instead do the sorting in 
Python -- check out the Rows.sort method: 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#find--exclude--sort.

Anthony

-- 
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: update_or_insert does not return id of record ?!

2016-10-24 Thread Anthony
It returns the id if a record is inserted, but not if updated (this allows 
you to distinguish between the two cases).

Anthony

On Monday, October 24, 2016 at 9:05:56 AM UTC-4, Ramos wrote:
>
> hello i noticed that
> db.mytable.update_or_insert(...) 
> does not return the id of the record updated or created
> Is this correct ? i would be nice to have it reurned
>
> Regards
> António
>

-- 
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: Deployment question

2016-10-24 Thread Richard Vézina
I suggest you try to raise the limit... I don't know why it get in the
configuration file, but I read it could be use to prevent memory leaks.
It's also help preventing app from eating all the memory before crash the
system... You maybe better understand why you code need so much memory and
try to limit the size of your data set if you can... For instance, maybe
you pull more data from the backend than you really need for your pandas
analysis?

http://uwsgi-docs-additions.readthedocs.io/en/latest/Options.html#limit-as

Glad that you found a lead to resolve you issue.

Richard

On Fri, Oct 21, 2016 at 2:30 PM, Jim S  wrote:

> Started looking in to this issue again today and found this:
> http://stackoverflow.com/questions/19439190/segmentation-fault-while-
> using-pandas-in-uwsgi
>
> I took the advice of Roberto and removed the --limit-as in
> /etc/uwsgi/web2py.ini - and now it seems to work find.  I am clueless as to
> what is going on here, but am really hoping that I've found a solution.
> Will report back if I have more news.
>
> -Jim
>
>
> On Wednesday, August 17, 2016 at 4:25:19 PM UTC-5, Jim S wrote:
>>
>> Thanks Dave
>>
>> While my stated question was specific to haproxy, I'm really speaking in
>> more general terms as to whether or not the rocket server would be
>> sufficient behind ANY load balancer.  I know I could have setup nginx as
>> the load balancer, but haproxy was really quite simple.
>>
>> I'm going to read through you link, thank you for that.
>>
>> -Jim
>>
>>
>> On Wed, Aug 17, 2016 at 4:04 PM, Dave S  wrote:
>>
>>>
>>>
>>> On Wednesday, August 17, 2016 at 1:15:58 PM UTC-7, Jim S wrote:

 Anyone else have thoughts on why I shouldn't use the rocket webserver
 behind haproxy?


>>> Well, before today I didn't know anything about haproxy, but it seems to
>>> have a good reputation as a load balancer.  So it should take care of
>>> scaling.
>>> I haven't yet found out about its security features.
>>>
>>> This page gives haproxy high marks from actual users, but most of the
>>> posts go back several years.  The most recent post
>>> provides an update of nginx's capabilities as of about a year ago.
>>> https://www.quora.com/Which-software-load-balancer-is-
>>> better-HAProxy-or-nginx>
>>>
>>> /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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>> pic/web2py/MTOjl8gPuTk/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.
>

-- 
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: Deployment question

2016-10-24 Thread Jim Steil
Thanks for the comment Richard - At the point it crashes I don't believe it
is an issue with my app.  It crashes on - import pandas as pd - so, I don't
think it is anything I'm doing in my code.

-Jim

On Mon, Oct 24, 2016 at 9:48 AM, Richard Vézina  wrote:

> I suggest you try to raise the limit... I don't know why it get in the
> configuration file, but I read it could be use to prevent memory leaks.
> It's also help preventing app from eating all the memory before crash the
> system... You maybe better understand why you code need so much memory and
> try to limit the size of your data set if you can... For instance, maybe
> you pull more data from the backend than you really need for your pandas
> analysis?
>
> http://uwsgi-docs-additions.readthedocs.io/en/latest/Options.html#limit-as
>
> Glad that you found a lead to resolve you issue.
>
> Richard
>
> On Fri, Oct 21, 2016 at 2:30 PM, Jim S  wrote:
>
>> Started looking in to this issue again today and found this:
>> http://stackoverflow.com/questions/19439190/segmentation-
>> fault-while-using-pandas-in-uwsgi
>>
>> I took the advice of Roberto and removed the --limit-as in
>> /etc/uwsgi/web2py.ini - and now it seems to work find.  I am clueless as to
>> what is going on here, but am really hoping that I've found a solution.
>> Will report back if I have more news.
>>
>> -Jim
>>
>>
>> On Wednesday, August 17, 2016 at 4:25:19 PM UTC-5, Jim S wrote:
>>>
>>> Thanks Dave
>>>
>>> While my stated question was specific to haproxy, I'm really speaking in
>>> more general terms as to whether or not the rocket server would be
>>> sufficient behind ANY load balancer.  I know I could have setup nginx as
>>> the load balancer, but haproxy was really quite simple.
>>>
>>> I'm going to read through you link, thank you for that.
>>>
>>> -Jim
>>>
>>>
>>> On Wed, Aug 17, 2016 at 4:04 PM, Dave S  wrote:
>>>


 On Wednesday, August 17, 2016 at 1:15:58 PM UTC-7, Jim S wrote:
>
> Anyone else have thoughts on why I shouldn't use the rocket webserver
> behind haproxy?
>
>
 Well, before today I didn't know anything about haproxy, but it seems
 to have a good reputation as a load balancer.  So it should take care of
 scaling.
 I haven't yet found out about its security features.

 This page gives haproxy high marks from actual users, but most of the
 posts go back several years.  The most recent post
 provides an update of nginx's capabilities as of about a year ago.
 https://www.quora.com/Which-software-load-balancer-is-b
 etter-HAProxy-or-nginx>

 /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 a topic in the
 Google Groups "web2py-users" group.
 To unsubscribe from this topic, visit https://groups.google.com/d/to
 pic/web2py/MTOjl8gPuTk/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.
>>
>
> --
> 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/MTOjl8gPuTk/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: Web2py freezing

2016-10-24 Thread piero crisci


I update the version and i tried also on a WINDOWS 7 with the same 
configuration.
Here is the difference beetwen the WINDOWS SERVER 2012R2 and WINDOWS 7 with 
the same configuration

*APACHE*

*Server version: Apache/2.4.23 (Win64)*

*Server built:   Oct  1 2016 08:28:43*

*Distributed by: The Apache Haus*

*Compiled with:  Visual Studio 2008*

*Server's Module Magic Number: 20120211:61*

*Server loaded:  APR 1.5.2, APR-UTIL 1.5.4*

*Compiled using: APR 1.5.2, APR-UTIL 1.5.4*

*Architecture:   64-bit*

*Server MPM: WinNT*

*  threaded: yes (fixed thread count)*

*forked: no*

*Server compiled with*

*-D APR_HAS_SENDFILE*

*-D APR_HAS_MMAP*

*-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)*

*-D APR_HAS_OTHER_CHILD*

*-D AP_HAVE_RELIABLE_PIPED_LOGS*

*-D DYNAMIC_MODULE_LIMIT=256*

*-D HTTPD_ROOT="/Apache24"*

*-D HTTPD_EXEC="/Apache24/bin/httpd.exe"*

*-D DEFAULT_PIDLOG="logs/httpd.pid"*

*-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"*

*-D DEFAULT_ERRORLOG="logs/error.log"*

*-D AP_TYPES_CONFIG_FILE="conf/mime.types"*

*-D SERVER_CONFIG_FILE="conf/httpd.conf"*

 

** The Apache Haus*

** is not affiliated with, or endorsed by, the Apache Software Foundation.*

** Apache HTTP Server, Apache, and the Apache feather logo are trademarks 
of*

** The Apache Software Foundation.*

 

*PYTHON*

*Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] 
on win*

*32*

*Type "help", "copyright", "credits" or "license" for more information.*

*>>> *

 

EPPURE LE PRESTAZIONI OTTENUTE SONO MOLTO DIVERSE

*Di seguito un benchmarking con il comando di APACHE:*

 

*SERVER  **

 

*Concurrency Level:  90*

*Time taken for tests:   131.909 seconds*

*Complete requests:  270*

*Failed requests:45*

*   (Connect: 0, Receive: 0, Length: 45, Exceptions: 0)*

*Keep-Alive requests:0*

*Total transferred:  1834657 bytes*

*HTML transferred:   1710187 bytes*

*Requests per second:2.05 [#/sec] (mean)*

*Time per request:   43969.754 [ms] (mean)*

*Time per request:   488.553 [ms] (mean, across all concurrent 
requests)*

*Transfer rate:  13.58 [Kbytes/sec] received*

 

*MY MACHINE*

 

Concurrency Level:  90

Time taken for tests:   28.872 seconds

Complete requests:  2700

Failed requests:0

Non-2xx responses:  2700

Keep-Alive requests:0

Total transferred:  820800 bytes

HTML transferred:   178200 bytes

*Requests per second:93.52 [#/sec] (mean)*

*Time per request:   962.384 [ms] (mean)*

*Time per request:   10.693 [ms] (mean, across all concurrent requests)*

*Transfer rate:  27.76 [Kbytes/sec] received*

Il giorno venerdì 21 ottobre 2016 12:47:48 UTC+2, 黄祥 ha scritto:
>
> perhaps its easier to give the error log rather than just the 
> configuration, learn from a lot of discussion in this forum apache is not 
> recommended
>
> 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.


Re: [web2py] Re: use jquery mobile with image upload functionality in web2py - is a hack is necessary?

2016-10-24 Thread Rob Paire
Ah that is a good, elegant solution; thank you for sharing. I did not know
of this trick before.

On Oct 21, 2016 4:54 PM, "Johnny Lupino"  wrote:

> Hi,
>
> It's been some time after you had posted your problem, but I found out
> another way of fixing it, since I could not find "//event.preventDefault();
> " anymore.
> Anyway, to make it possible to submit a form using jqmobile plugin , I
> only needed to add an extra attribute to my form - which is
> data-ajax='false'.
> In controller e.g default.py , after your form definition add:
> form['data-ajax]'='false' and it should work.
> I'm sure you know it by now, but it is always good to share
> knowledge/experience.
> ATB,
> Archie
>
> On Friday, October 3, 2014 at 6:59:13 PM UTC+2, Rob Paire wrote:
>>
>> Hello all,
>> I am working on an app using web2py and the jquery.mobile plug-in which I
>> upgraded from v1.3.1 to v1.3.2. So far everything is working fine except
>> for the image upload feature. I managed to solve the problem and enable the
>> upload, but I had to hack the jquery.mobile-1.3.2.js source to make it
>> work. I am making this post in order to share my experience.
>>
>> Here is the situation: when the view to do the upload includes the normal
>> layout file everything works as expected. However, when using the
>> plugin_jqmobile/layout.html, the upload fails with the jquery.mobile
>> message "Error Loading Page" - in short the web2py callback fails. The
>> record does not get inserted, neither does the response.flash error message
>> appear. A couple of long sessions with javascript debugger and reading //
>> api.jquery.com/submit eventually led me to suspect
>> event.preventDefault() was causing the error. Indeed it was true, when I
>> commented out that line of code, the upload was successful. Below is the
>> modified code snippet from jquery.mobile-1.3.2.js (this problem also exists
>> in jqm v1.3.1)
>>
>> //bind to form submit events, handle with Ajax
>> $.mobile.document.delegate( "form", "submit", function( event ) {
>> var formData = getAjaxFormData( $( this ) );
>>
>> if ( formData ) {
>> $.mobile.changePage( formData.url, formData.options );
>> //event.preventDefault();  //turned this off to enable web2py callbacks
>> }
>> });
>>
>> I am going to proceed with further testing. If there is a better
>> solution, please let me know. Thank you.
>>
>> In my controller I have the following standard code:
>> form = SQLFORM(db.documnt)
>> if form.accepts(request, session):
>> response.flash = 'form accepted:'+str(form.vars.id)
>> make_thumbnail(db.documnt,form.vars.id,(175,175))
>> elif form.errors:
>> response.flash = 'form has errors...'
>> return dict(form=form)
>>
>> And the associated view:
>>   {{#extend 'layout.html'}}
>>   {{extend 'plugin_jqmobile/layout.html'}}
>>
>> 
>> {{=form}}
>> 
>>
>>
>>
>> --
> 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/oAXejH_jidk/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.


Re: [web2py] Hide flash message after some elapsed time instead of on click

2016-10-24 Thread Marc Smith
Thank you, that did the trick.

--Marc

On Fri, Oct 21, 2016 at 5:00 PM, Scott Hunter  wrote:
> You need single-quotes around
> flash.fadeOut("slow")
>
> Otherwise, as you have seen, it gets executed immediately instead of after a
> delay.
>
>
> On Tuesday, October 18, 2016 at 9:35:30 AM UTC-4, Marc Smith wrote:
>>
>> Hi,
>>
>> I'm relatively new to JS but the strange quote character at the
>> beginning (I thought it was a back-tick, but doesn't appear it is) and
>> single quote at the end in that line don't look right to me -- is that
>> correct? I tried the code with Jim's change of using ".w2p_flash" but
>> it still doesn't work for me.
>>
>> This is what the block of JS from web2py.js looks like currently:
>> --snip--
>>/*helper for flash messages*/
>>flash: function(message, status) {
>>  var flash = $('.w2p_flash');
>>  web2py.hide_flash();
>>  flash.html(message).addClass(status);
>>  if(flash.html()) flash.append(' ×
>> ').slideDown();
>>},
>>hide_flash: function() {
>>  $('.w2p_flash').fadeOut(0).html('');
>>},
>> --snip--
>>
>> I tried adding this line:
>> setTimeout(flash.fadeOut("slow"),5000);
>>
>> But the message fades in and out in about a second, and in Chrome's
>> developer panel, I see a "(program):1 Uncaught SyntaxError: Unexpected
>> identifier" error.
>>
>> Any help would be greatly appreciated.
>>
>>
>> --Marc
>>
>> On Wed, Jul 13, 2016 at 6:41 PM, Jim Brouzoulis
>>  wrote:
>> > Thank you very much for your help! (...and sorry for the late reply)
>> >
>> > It didn't work at first but then I noticed a typo: the class should be
>> > '.w2p_flash'.
>> >
>> > Regards
>> > // Jim
>> >
>> >
>> > Den måndag 11 juli 2016 kl. 10:49:08 UTC+2 skrev Massimiliano:
>> >>
>> >> Hi Jim,
>> >> I’m doing it in this way:
>> >>
>> >> Edit static/web2py.js search for /*helper for flash messages*/
>> >>
>> >> and add this command:
>> >>
>> >> setTimeout(‘jQuery(".flash").fadeOut("slow")',5000);
>> >>
>> >> just after:
>> >>
>> >> if (flash.html()) flash.append(' ×
>> >> ').slideDown();
>> >>
>> >> Adjust 5000 that stands for 5 secods to your needs.
>> >>
>> >>
>> >> On Thu, Jul 7, 2016 at 6:00 PM, Jim Brouzoulis 
>> >> wrote:
>> >>>
>> >>> Hi everyone,
>> >>>
>> >>> Can I easily customise the web2py.js file to automatically hide/fade
>> >>> out
>> >>> the flash message after some given time (like a few seconds) instead
>> >>> of
>> >>> clicking on it? If so, how?
>> >>> I have a feeling that the solution is probably not that complicated
>> >>> but
>> >>> my js-skills aren't very impressive :)
>> >>>
>> >>> Regards
>> >>> // Jim
>> >>>
>> >>> --
>> >>> 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.
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Massimiliano
>> >
>> > --
>> > 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.

-- 
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: Deployment question

2016-10-24 Thread Richard Vézina
You right, I forgot... But you may try by raising the limit... Is there any
open issue for pandas about that... This is not normal... If I remember it
does that only in web2py environment?

If the issue occurs on import pandas as pd why I don't have it??

I have : limit-as 512

I have pandas 0.19.0

Ubuntu 16.04 64 bit

web2py 2.14.6

uwsgi 2.0.14

Richard



On Mon, Oct 24, 2016 at 10:55 AM, Jim Steil  wrote:

> Thanks for the comment Richard - At the point it crashes I don't believe
> it is an issue with my app.  It crashes on - import pandas as pd - so, I
> don't think it is anything I'm doing in my code.
>
> -Jim
>
> On Mon, Oct 24, 2016 at 9:48 AM, Richard Vézina <
> ml.richard.vez...@gmail.com> wrote:
>
>> I suggest you try to raise the limit... I don't know why it get in the
>> configuration file, but I read it could be use to prevent memory leaks.
>> It's also help preventing app from eating all the memory before crash the
>> system... You maybe better understand why you code need so much memory and
>> try to limit the size of your data set if you can... For instance, maybe
>> you pull more data from the backend than you really need for your pandas
>> analysis?
>>
>> http://uwsgi-docs-additions.readthedocs.io/en/latest/Options
>> .html#limit-as
>>
>> Glad that you found a lead to resolve you issue.
>>
>> Richard
>>
>> On Fri, Oct 21, 2016 at 2:30 PM, Jim S  wrote:
>>
>>> Started looking in to this issue again today and found this:
>>> http://stackoverflow.com/questions/19439190/segmentation-fa
>>> ult-while-using-pandas-in-uwsgi
>>>
>>> I took the advice of Roberto and removed the --limit-as in
>>> /etc/uwsgi/web2py.ini - and now it seems to work find.  I am clueless as to
>>> what is going on here, but am really hoping that I've found a solution.
>>> Will report back if I have more news.
>>>
>>> -Jim
>>>
>>>
>>> On Wednesday, August 17, 2016 at 4:25:19 PM UTC-5, Jim S wrote:

 Thanks Dave

 While my stated question was specific to haproxy, I'm really speaking
 in more general terms as to whether or not the rocket server would be
 sufficient behind ANY load balancer.  I know I could have setup nginx as
 the load balancer, but haproxy was really quite simple.

 I'm going to read through you link, thank you for that.

 -Jim


 On Wed, Aug 17, 2016 at 4:04 PM, Dave S  wrote:

>
>
> On Wednesday, August 17, 2016 at 1:15:58 PM UTC-7, Jim S wrote:
>>
>> Anyone else have thoughts on why I shouldn't use the rocket webserver
>> behind haproxy?
>>
>>
> Well, before today I didn't know anything about haproxy, but it seems
> to have a good reputation as a load balancer.  So it should take care of
> scaling.
> I haven't yet found out about its security features.
>
> This page gives haproxy high marks from actual users, but most of the
> posts go back several years.  The most recent post
> provides an update of nginx's capabilities as of about a year ago.
> https://www.quora.com/Which-software-load-balancer-is-b
> etter-HAProxy-or-nginx>
>
> /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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/web2py/MTOjl8gPuTk/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.
>>>
>>
>> --
>> 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/to
>> pic/web2py/MTOjl8gPuTk/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://web

[web2py] Re: change the size of a text field in a form

2016-10-24 Thread Steven Vannoy
This is exactly what I'm trying to do, none of the suggestions below has 
changed my form view at all. Must be doing something wrong. I'm trying to 
avoid using a custom.widget so I don't have to specifically layout everyone 
of my fields, there are over 30, but I want them to be a fixed width so 
when the field is displayed, I can also have it be a fixed width and the 
person entering text will know how wide the viewable area is.



On Wednesday, May 16, 2012 at 11:59:14 AM UTC-4, Marco Prosperi wrote:
>
>
> hello, how can I change the default size of a 'text' field in a form? (at 
> first appearance, not dragging the corner)
>
> thanks
>
> Marco
>

-- 
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] Migrate integer field to string type

2016-10-24 Thread Ian W. Scott
I'm using Postgresql and I need to migrate the data type of a field from 
"integer" to "string". Will it work to just change the field type in the 
model table definition? What will happen to the existing "integer" data? 
Any problems foreseen?

Thanks,

Ian

-- 
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] What kind of application is web2py for designing and what kind of application it isn't as good?

2016-10-24 Thread Mike Stephenson
for example, you may compare chatting and other kinds.

-- 
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] What kind of application is web2py good for designing and what kind of application it isn't as good?

2016-10-24 Thread Mike Stephenson
for example, you may compare chatting and other kinds.

-- 
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: change the size of a text field in a form

2016-10-24 Thread Richard Vézina
F5 or Ctrl+R or delete cache may help sometimes... But it hards to know
what you may doing wrong without any code...

Richard

On Mon, Oct 24, 2016 at 12:56 PM, Steven Vannoy 
wrote:

> This is exactly what I'm trying to do, none of the suggestions below has
> changed my form view at all. Must be doing something wrong. I'm trying to
> avoid using a custom.widget so I don't have to specifically layout everyone
> of my fields, there are over 30, but I want them to be a fixed width so
> when the field is displayed, I can also have it be a fixed width and the
> person entering text will know how wide the viewable area is.
>
>
>
> On Wednesday, May 16, 2012 at 11:59:14 AM UTC-4, Marco Prosperi wrote:
>>
>>
>> hello, how can I change the default size of a 'text' field in a form? (at
>> first appearance, not dragging the corner)
>>
>> thanks
>>
>> Marco
>>
> --
> 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: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-24 Thread Peter

Just to close this off.

I think I am in a bit of a catch 22.. 

Because the behaviour *is exactly what I want   *i.e. stream goes straight 
to download option, I don't get the open/save dialogue so can't change the 
setting and after reading this (possibly related Firefox bug report)*   
https://bugzilla.mozilla.org/show_bug.cgi?id=1109420*  I'm more than happy 
to leave well enough alone and not go down the rabbit hole.

Thanks again Niphlod & Paolo for your inputs! 

-- 
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: Deployment question

2016-10-24 Thread Jim Steil
Yes, it's crazy.  I have 2 ubuntu 14.04 servers that work fine, pandas 0.18
(I have other issues with 0.19.0 so haven't moved there yet, but still had
the same behavior when I tested).  But, any new Ubuntu 14.04 servers I
install won't work.  Any time i try 16.10 or 16.04 (which is what i want to
use) I get the pandas failures.  But, just stumbled upon this resolution to
comment out that line.  So, can't say what the real problem is.

Oh wait, just saw that you specified your uwsgi version.  I'm not sure what
I have on the various servers but will check it when I get to the office
tomorrow.

-Jim


On Mon, Oct 24, 2016 at 11:20 AM, Richard Vézina <
ml.richard.vez...@gmail.com> wrote:

> You right, I forgot... But you may try by raising the limit... Is there
> any open issue for pandas about that... This is not normal... If I remember
> it does that only in web2py environment?
>
> If the issue occurs on import pandas as pd why I don't have it??
>
> I have : limit-as 512
>
> I have pandas 0.19.0
>
> Ubuntu 16.04 64 bit
>
> web2py 2.14.6
>
> uwsgi 2.0.14
>
> Richard
>
>
>
> On Mon, Oct 24, 2016 at 10:55 AM, Jim Steil  wrote:
>
>> Thanks for the comment Richard - At the point it crashes I don't believe
>> it is an issue with my app.  It crashes on - import pandas as pd - so, I
>> don't think it is anything I'm doing in my code.
>>
>> -Jim
>>
>> On Mon, Oct 24, 2016 at 9:48 AM, Richard Vézina <
>> ml.richard.vez...@gmail.com> wrote:
>>
>>> I suggest you try to raise the limit... I don't know why it get in the
>>> configuration file, but I read it could be use to prevent memory leaks.
>>> It's also help preventing app from eating all the memory before crash the
>>> system... You maybe better understand why you code need so much memory and
>>> try to limit the size of your data set if you can... For instance, maybe
>>> you pull more data from the backend than you really need for your pandas
>>> analysis?
>>>
>>> http://uwsgi-docs-additions.readthedocs.io/en/latest/Options
>>> .html#limit-as
>>>
>>> Glad that you found a lead to resolve you issue.
>>>
>>> Richard
>>>
>>> On Fri, Oct 21, 2016 at 2:30 PM, Jim S  wrote:
>>>
 Started looking in to this issue again today and found this:
 http://stackoverflow.com/questions/19439190/segmentation-fa
 ult-while-using-pandas-in-uwsgi

 I took the advice of Roberto and removed the --limit-as in
 /etc/uwsgi/web2py.ini - and now it seems to work find.  I am clueless as to
 what is going on here, but am really hoping that I've found a solution.
 Will report back if I have more news.

 -Jim


 On Wednesday, August 17, 2016 at 4:25:19 PM UTC-5, Jim S wrote:
>
> Thanks Dave
>
> While my stated question was specific to haproxy, I'm really speaking
> in more general terms as to whether or not the rocket server would be
> sufficient behind ANY load balancer.  I know I could have setup nginx as
> the load balancer, but haproxy was really quite simple.
>
> I'm going to read through you link, thank you for that.
>
> -Jim
>
>
> On Wed, Aug 17, 2016 at 4:04 PM, Dave S  wrote:
>
>>
>>
>> On Wednesday, August 17, 2016 at 1:15:58 PM UTC-7, Jim S wrote:
>>>
>>> Anyone else have thoughts on why I shouldn't use the rocket
>>> webserver behind haproxy?
>>>
>>>
>> Well, before today I didn't know anything about haproxy, but it seems
>> to have a good reputation as a load balancer.  So it should take care of
>> scaling.
>> I haven't yet found out about its security features.
>>
>> This page gives haproxy high marks from actual users, but most of the
>> posts go back several years.  The most recent post
>> provides an update of nginx's capabilities as of about a year ago.
>> https://www.quora.com/Which-software-load-balancer-is-b
>> etter-HAProxy-or-nginx>
>>
>> /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 a topic in
>> the Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/MTOjl8gPuTk/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

[web2py] Tornado

2016-10-24 Thread William
How to run my own tornado file on 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] CouchDB support

2016-10-24 Thread Robert F
Still on the learning curve regarding Web2py but would like to know how to 
use the CouchDB DAL interface. CouchDB is mentioned in the support docs but 
does not appear during start up in list of database adapters found. For 
example I get:

Database drivers available:  psycopg2, pymysql, imaplib, MySQLdb, sqlite3, 
pyodbc



Looked at the PyDAL code base and CouchDB support appears to be present but 
just is not detected/enabled. (import not found) I have tried both binary 
and source distributions.

What steps do I need to do to enable CouchDB or any other non-standard 
adapter not listed during startup?

Any indications on how mature adapter is.  


-- 
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] Add direct link in grid to edit page for connected table

2016-10-24 Thread Nicola Clementel
 

Hi,


I have several tables connected in the following way:


db.define_table('table_1',

Field('name',unique=True))


db.define_table('table_2',

Field(),

.

Field('ref_t1','reference 
table_1',requires=IS_IN_DB(db,db.table_1.id,'%(name)s')))


db.define_table('table_3',

Field(),

.

Field('ref_t2','reference table_2',requires=IS_IN_DB(db,db.table_2.id)))


db.define_table('table_4',

Field(),

.

Field('ref_t2','reference table_2',requires=IS_IN_DB(db,db.table_2.id)))



Ignoring for the moment the connection with table_1, I would like to add in 
the view for table_2 a direct link to edit table_3 (every grid row of 
table_2 as a 1-to-1 connection with a single instance of table_3 or 4).


Using grid I'm trying to set a link this way:


grid=SQLFORM.grid(db.table_2,.,links = [lambda row: A ('modify', 
_href=URL('index', args=['edit','table_3', 
*db(db.table_3.ref_t2==row.id).select(db.table_3.id).first().id*
],user_signature=True),_class="btn")])


but it is not working and I can't understand why, since if I substitute 
"row.id" hardcoding the id of the row in the grid, it is working (clearly 
only for one row).

The error is:  * 'NoneType' object has no 
attribute 'id'*


An other option might be to change the link that display the children list 
in smartgrid to point directly to the edit page for the only child, but I'm 
not sure how to do it.


Any suggestion on how to solve this?


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 deploy in GAE

2016-10-24 Thread Massimo Di Pierro
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
cd web2py
cp examples/app.example.yaml app.yaml
cp handler/gaehandler.py gaehandler.py

EDIT app.yaml and replace "yourappname with" your application name

deploy with
   cd ..

   appcfg.py update web2py
or with
gcloud app deploy web2py/app.yaml


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

2016-10-24 Thread Massimo Di Pierro
Something is very wrong here and I do not know what it is. Why are you 
suing apache with WSCGI. This is not a recommended configuration. We do not 
support Apache any more and we never supported WSCGI. Can you try rocket 
and nginx?

On Monday, 24 October 2016 10:47:49 UTC-5, piero crisci wrote:
>
> I update the version and i tried also on a WINDOWS 7 with the same 
> configuration.
> Here is the difference beetwen the WINDOWS SERVER 2012R2 and WINDOWS 7 
> with the same configuration
>
> *APACHE*
>
> *Server version: Apache/2.4.23 (Win64)*
>
> *Server built:   Oct  1 2016 08:28:43*
>
> *Distributed by: The Apache Haus*
>
> *Compiled with:  Visual Studio 2008*
>
> *Server's Module Magic Number: 20120211:61*
>
> *Server loaded:  APR 1.5.2, APR-UTIL 1.5.4*
>
> *Compiled using: APR 1.5.2, APR-UTIL 1.5.4*
>
> *Architecture:   64-bit*
>
> *Server MPM: WinNT*
>
> *  threaded: yes (fixed thread count)*
>
> *forked: no*
>
> *Server compiled with*
>
> *-D APR_HAS_SENDFILE*
>
> *-D APR_HAS_MMAP*
>
> *-D APR_HAVE_IPV6 (IPv4-mapped addresses disabled)*
>
> *-D APR_HAS_OTHER_CHILD*
>
> *-D AP_HAVE_RELIABLE_PIPED_LOGS*
>
> *-D DYNAMIC_MODULE_LIMIT=256*
>
> *-D HTTPD_ROOT="/Apache24"*
>
> *-D HTTPD_EXEC="/Apache24/bin/httpd.exe"*
>
> *-D DEFAULT_PIDLOG="logs/httpd.pid"*
>
> *-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"*
>
> *-D DEFAULT_ERRORLOG="logs/error.log"*
>
> *-D AP_TYPES_CONFIG_FILE="conf/mime.types"*
>
> *-D SERVER_CONFIG_FILE="conf/httpd.conf"*
>
>  
>
> ** The Apache Haus*
>
> ** is not affiliated with, or endorsed by, the Apache Software Foundation.*
>
> ** Apache HTTP Server, Apache, and the Apache feather logo are trademarks 
> of*
>
> ** The Apache Software Foundation.*
>
>  
>
> *PYTHON*
>
> *Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] 
> on win*
>
> *32*
>
> *Type "help", "copyright", "credits" or "license" for more information.*
>
> *>>> *
>
>  
>
> EPPURE LE PRESTAZIONI OTTENUTE SONO MOLTO DIVERSE
>
> *Di seguito un benchmarking con il comando di APACHE:*
>
>  
>
> *SERVER  **
>
>  
>
> *Concurrency Level:  90*
>
> *Time taken for tests:   131.909 seconds*
>
> *Complete requests:  270*
>
> *Failed requests:45*
>
> *   (Connect: 0, Receive: 0, Length: 45, Exceptions: 0)*
>
> *Keep-Alive requests:0*
>
> *Total transferred:  1834657 bytes*
>
> *HTML transferred:   1710187 bytes*
>
> *Requests per second:2.05 [#/sec] (mean)*
>
> *Time per request:   43969.754 [ms] (mean)*
>
> *Time per request:   488.553 [ms] (mean, across all concurrent 
> requests)*
>
> *Transfer rate:  13.58 [Kbytes/sec] received*
>
>  
>
> *MY MACHINE*
>
>  
>
> Concurrency Level:  90
>
> Time taken for tests:   28.872 seconds
>
> Complete requests:  2700
>
> Failed requests:0
>
> Non-2xx responses:  2700
>
> Keep-Alive requests:0
>
> Total transferred:  820800 bytes
>
> HTML transferred:   178200 bytes
>
> *Requests per second:93.52 [#/sec] (mean)*
>
> *Time per request:   962.384 [ms] (mean)*
>
> *Time per request:   10.693 [ms] (mean, across all concurrent 
> requests)*
>
> *Transfer rate:  27.76 [Kbytes/sec] received*
>
> Il giorno venerdì 21 ottobre 2016 12:47:48 UTC+2, 黄祥 ha scritto:
>>
>> perhaps its easier to give the error log rather than just the 
>> configuration, learn from a lot of discussion in this forum apache is not 
>> recommended
>>
>> 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: Deployment question

2016-10-24 Thread Massimo Di Pierro
Rocket is a multithreaded server and pandas is not thread safe 
(http://pandas.pydata.org/pandas-docs/stable/gotchas.html) be very careful 
with it. 

On Tuesday, 16 August 2016 13:19:42 UTC-5, Dave S wrote:
>
>
>
> On Tuesday, August 16, 2016 at 8:50:51 AM UTC-7, Jim S wrote:
>>
>> Hi 
>>
>> I currently have my app deployed using Ubuntu 14.04 / nginx / uwsgi.  I 
>> have a couple of servers load-balanced behind a haproxy server.  I'm 
>> running ssl on the haproxy system and talking http to web2y through 
>> nginx/uwsgi.
>>
>> Now, I'm trying to upgrade ubuntu to 16.04 and an having issues with 
>> pandas (used in my web2py app) through the nginx/uwsgi stack.  See this 
>> issue for what might be causing it - 
>> http://stackoverflow.com/questions/19439190/segmentation-fault-while-using-pandas-in-uwsgi
>>
>> Fixing this error is obviously something beyond my capabilities so it got 
>> me thinking about alternative deployment options.  One that I'm considering 
>> is replacing my nginx / uwsgi stack with just the rocket server to serve 
>> the web2py app.  My rocket servers (2 of them) would be behind the haproxy 
>> server so would not be public-facing.
>>
>> I'm aware of the recommendation against running rocket in a production 
>> environment but am not aware of the reasons for the recommendation.
>>
>> My question - does running multiple rocket servers behind haproxy remove 
>> the concerns about rocket in a production environment?
>>
>> -Jim
>>
>
>
> I'm not familiar with Pandas, so I can't comment on that part.  I run 
> rocket, but only a single instance as a development environment.  Perhaps 
> Mariano and Massimo have tested other configurations, but I think the bulk 
> of us using rocket only run a single instance. 
>
> What are the specific rocket concerns?  Scaling?
>
> /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] SQLFORM grid search : Get ids of filtered records

2016-10-24 Thread Madhavi
Hi,

I am new to web2py and am working on application with a SQLFORM grid with 
the search feature along with selectable option. I added extra buttons to 
my grid to set a boolean value for selected records using selectable 
feature, and added another button to set a boolean value for all the 
records in the table. Now, I also want to add a button the set this value 
for only filtered records using the search feature. Is there a way using 
which I can refer to the ids of only those records which are filtered 
through the search widget to perform this manipulation only on those 
records? To explain better, I have the below buttons in place:

1. Set true for all selected records
2. Set true for all records

I also want to add an option to:

3. Set true for filtered records (filtered records refer to the ones 
displayed on performing the search in the grid).

Please let me know if this is possible,

Thanks a ton,

Madhavi

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

2016-10-24 Thread piero crisci
Hi massimo and thanks fot the hint
I tried with rocket from cmd line and this is result from Apache ab command 
line.
I got the same result i have with APACHE WSGI as you can see below


*MY APP WITH ROCKET *
This is the command launch
C:\web2py>python web2py.py
*No handlers could be found for logger "web2py"*
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2016
*Version 2.14.3-stable+timestamp.2016.03.26.23.02.0*2
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
please visit:
http://10.51.130.53/
starting browser...
please visit:
http://10.51.130.53:8080/
starting browser...


C:\Apache24\bin>ab -n 270 -c 90 -k -s 100 
10.51.130.53:8080/Prototipo_RCG/defaul
t/index
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.51.130.53 (be patient)
Completed 100 requests
Completed 200 requests
Finished 270 requests


Server Software:Rocket
Server Hostname:10.51.130.53
Server Port:8080

Document Path:  /Prototipo_RCG/default/index
Document Length:6437 bytes

Concurrency Level:  90
Time taken for tests:   115.700 seconds
Complete requests:  270
Failed requests:43
   (Connect: 0, Receive: 0, Length: 43, Exceptions: 0)
Keep-Alive requests:0
Total transferred:  1856249 bytes
HTML transferred:   1737989 bytes
*Requests per second:2.33 [#/sec] (mean)*
*Time per request:   38566.756 [ms] (mean)*
*Time per request:   428.520 [ms] (mean, across all concurrent 
requests)*
*Transfer rate:  15.67 [Kbytes/sec] received*

Connection Times (ms)
  min  mean[+/-sd] median   max


*WINDOWS GENERIC WEB2PY APP FROM WEB2PY.EXE*
C:\Apache24\bin>ab -n 270 -c 90 -k -s 100 
10.51.130.53:8080/welcome/default/inde
x
This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.51.130.53 (be patient)
Completed 100 requests
Completed 200 requests
Finished 270 requests


Server Software:Rocket
Server Hostname:10.51.130.53
Server Port:8080

Document Path:  /welcome/default/index
Document Length:11001 bytes

Concurrency Level:  90
Time taken for tests:   18.046 seconds
Complete requests:  270
Failed requests:0
Keep-Alive requests:0
Total transferred:  3087180 bytes
HTML transferred:   2970270 bytes
*Requests per second:14.96 [#/sec] (mean)*
*Time per request:   6015.390 [ms] (mean)*
*Time per request:   66.838 [ms] (mean, across all concurrent requests)*
*Transfer rate:  167.06 [Kbytes/sec] received*

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:0   34 127.0  0 516
Processing:  3046 4541 915.5   41566231
Waiting: 2035 4114 1126.0   37966231
Total:   3046 4575 902.1   44846231

Percentage of the requests served within a certain time (ms)
  50%   4484
  66%   4597
  75%   5082
  80%   5582
  90%   6106
  95%   6137
  98%   6168
  99%   6184
 100%   6231 (longest request)

*GENERAL APP **WITH LAST VERSION OF WEB2PY **STARTED FROM CODE WEB2PY.PY*

C:\Apache24\bin>ab -n 270 -c 90 -k -s 100 
10.51.130.53:8080/welcome/default/index

This is ApacheBench, Version 2.3 <$Revision: 1748469 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.51.130.53 (be patient)
Completed 100 requests
Completed 200 requests
Finished 270 requests


Server Software:Rocket
Server Hostname:10.51.130.53
Server Port:8080

Document Path:  /welcome/default/inde
Document Length:66 bytes

Concurrency Level:  90
Time taken for tests:   8.229 seconds
Complete requests:  270
Failed requests:0
Non-2xx responses:  270
Keep-Alive requests:0
Total transferred:  105570 bytes
HTML transferred:   17820 bytes
*Requests per second:32.81 [#/sec] (mean)*
*Time per request:   2742.840 [ms] (mean)*
*Time per request:   30.476 [ms] (mean, across all concurrent requests)*
*Transfer rate:  12.53 [Kbytes/sec] received*

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:00   0.0  0   0
Processing:   297 2342 701.0   26882859
Waiting:  297 2341 701.0   26882859
Total:297 2342 701.0   26882859

Percentage of the requests served within a certain time (ms)
  50%   2688
  66%   2729
  75%   2744
  80%   2756
  90%   2781
  95%   2813
  98%   2844
  99%   2844
 100%   2859 (longest request)

I could depend on version? 


Il giorno martedì 25 ottobre 2016 07:16:08 UTC+2, Massimo Di Pierro ha 
scritto:
>
> Something is very wrong