[web2py] Re: Weird problems generating menu from database

2017-08-01 Thread Вячеслав Анатольевич
Have some idea about this?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Rocket server crashing with socket error

2017-08-01 Thread Kiran Subbaraman
About 2 months ago, did anything change in the usage of your application 
- more clients connecting to it, are the payloads in these connections 
growing in size, etc?
In that case, moving to a more performant web server would help. Nginx 
is recommended here. Is moving to nginx, instead of the rocket server, 
an option that you can consider?


As an aside: this open issue in the rocket repo makes for interesting 
reading: https://github.com/explorigin/Rocket/issues/1


If you intend to continue with the current setup, then you may want to 
try some of these:


 * Do you see any further details in the /web2py/httpserver.log
 * Edit the /web2py/logging.conf , and set the logging level to DEBUG
   for web2py & rocket, and see if there are more details in the
   resulting log file.
 * Are you able to recreate the problem using some test code on your
   side ... if so please share that on the forum here. I think you
   would need the test code to try multiple things - concurrent
   requests to the server, or  POST increasingly bigger payloads, etc.



Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 02-Aug-17 12:33 AM, Fabiano Faver wrote:

environment: Debian 7.11; python 2.7.3; web2py 2.14.5 running on rocket

background:
An application that have many clients periodically sending data, some 
are http posts some others json.


About 2 month ago it started to eventually throwing this error on console:

2017-08-01 15:50:37,966 - Rocket.Errors.Thread-8 - ERROR - Tried to 
send "400 Bad Request" to client but received socket error


But it got much more frequent and now it is like every 5 minutes and 
sometimes it crashes rocket server, then I need to restart it.


I have no idea what's causing this or where I can get a better traceback.

Someone have a idea what is this problem or hint i can follow?
--
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: Rocket server crashing with socket error

2017-08-01 Thread Dave S


On Tuesday, August 1, 2017 at 12:03:37 PM UTC-7, Fabiano Faver wrote:
>
> environment: Debian 7.11; python 2.7.3; web2py 2.14.5 running on rocket
>
> background:
> An application that have many clients periodically sending data, some are 
> http posts some others json. 
>
> About 2 month ago it started to eventually throwing this error on console:
>
> 2017-08-01 15:50:37,966 - Rocket.Errors.Thread-8 - ERROR - Tried to send 
> "400 Bad Request" to client but received socket error
>
> But it got much more frequent and now it is like every 5 minutes and 
> sometimes it crashes rocket server, then I need to restart it.
>
> I have no idea what's causing this or where I can get a better traceback.
>
> Someone have a idea what is this problem or hint i can follow?
>

I have no idea.  I run Rocket on AWS without problem, but the traffic is 
low.   I also run Rocket on W10, and sometimes I see "waiting for socket" 
appear, but that only seems to affect speed, and traffic is also low (more 
but shorter requests than the AWS environment, but easily 1 minute or more 
between requests).  I suspect that "sleeping" the W10 when I go to bed 
causes some problems with the socket, but that wouldn't apply to you.

There may be file locks involved in Rocket, but that's just a WAG (no 'S').

/dps

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Integrating existing web2py with GitHub

2017-08-01 Thread Marlysson Silva
Do you want more easy than git command line? A interface maybe...?

Or automatize this process to send to remote repository.

Em sexta-feira, 28 de julho de 2017 13:13:23 UTC-3, William Ross escreveu:
>
> Hello, I have an existing web2py project that I edit through the admin 
> interface. To backup the project I am manually pushing that code to a 
> GitHub.
>
> I saw that under the 'Manage' tab there are options to 'Git Pull' and 'Git 
> Push' which requires the gitpython module. Looking through threads on this 
> subject from the Google Group there was discussion in 2012 that said these 
> GitHub buttons are experimental.
>
> Are those buttons still experimental currently?
>
> What's the best way to seamlessly integrate my web2py project with GitHub?
>
> 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] Rocket server crashing with socket error

2017-08-01 Thread Fabiano Faver
environment: Debian 7.11; python 2.7.3; web2py 2.14.5 running on rocket

background:
An application that have many clients periodically sending data, some are 
http posts some others json. 

About 2 month ago it started to eventually throwing this error on console:

2017-08-01 15:50:37,966 - Rocket.Errors.Thread-8 - ERROR - Tried to send 
"400 Bad Request" to client but received socket error

But it got much more frequent and now it is like every 5 minutes and 
sometimes it crashes rocket server, then I need to restart it.

I have no idea what's causing this or where I can get a better traceback.

Someone have a idea what is this problem or hint i can follow?

-- 
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] Datatables Query String Parsing

2017-08-01 Thread villas
Hi Richard,

Thanks for your points of view and I find the discussion interesting.  
However I'm not sure that we are on the same page:

For me, I would defenitly avoid using DTs as I found those kind of fancy 
> grid too heavy (to many plugins, to many js, flash stuff, etc.)


Datatables is not that heavy and,  anyhow,  that isn't the problem because 
it performs well when loaded,  which sqlform.grid does not.

I would prefer bare html/css closer solution, like build html table 
> populate it and drop css from boostrap or other CSS lib. In this regard 
> SQLFORM.grid is almost perfect


My point is that sqlform.grid is often totally inadequate for my needs: it 
doesn't paginate loaded datasets, cannot populate via ajax,  and makes far 
too many queries.  All of which means I have to make my own solutions 
(which I am not very good at).  

Don't get me wrong,  I am very grateful for what web2py does for me,  but I 
am just talking specifically about the grid here.

I was interested in the vue.js,  but I'm not entirely sure how it solves my 
problem of producing an efficient data grid listing.  

Best wishes. 


 

On Monday, 31 July 2017 17:25:59 UTC+1, Richard wrote:
>
> Yes Villas you get good points...
>
> I think Massimo's had talked about abandonning SQLFROM.grid. I never been 
> able to fully levrage it. Most of the time, I prefer handle forms myself, 
> as they most of the time more complexe the what .grid() can handle. So 
> there is no gain to having them to me... Tough I think we should look at 
> SQLFORM.grid as a prototyping tools as CRUD was more then an end solution 
> for crafting our apps. You build a prototype app fast then you rewrite it 
> and use proper customized tools for the real final product... But it far 
> from ideal... But I am not sure any frameworks can meet expectations of the 
> broad wild audience... Some will argue that they don't want you to specify 
> the grid they are going to use, other want it built in... For me, I would 
> defenitly avoid using DTs as I found those kind of fancy grid too heavy (to 
> many plugins, to many js, flash stuff, etc.)... I would prefer bare 
> html/css closer solution, like build html table populate it and drop css 
> from boostrap or other CSS lib. In this regard SQLFORM.grid is almost 
> perfect, but I think it should be rewrite entirely with proper requirements 
> and to me it should be strip to it main purpose GRID... Like this you don't 
> have to manage complexe redirection with args and vars, etc. It should 
> accept complexe query, so you are not limited to use it over as single 
> table, CRUD select was good in this respect.
>
> In the future w3p
>
> I guess in the future web3py will not offer anything like SQLFORM.grid, 
> just me thinking, base on what Massimo's has mention so far about web3py...
>
> I think grid stuff will have to be handle more like this :
>
> https://vuejs.org/v2/examples/grid-component.html
>
> https://www.ag-grid.com/angular-getting-started/#gsc.tab=0
>
>
>
> On Mon, Jul 31, 2017 at 11:16 AM, villas > 
> wrote:
>
>> Hi Richard / everyone
>>
>> Those are good strategies.  However,  I also feel that it is a pity that 
>> we are having to 'roll our own' solutions because the sqlform.grid just 
>> seems too slow.
>>
>> Your idea of avoiding pyDAL seems to greatly reduce queries,  and so I am 
>> also tempted down this road.  However,  again,  this undermines the whole 
>> point of the framework.  
>>
>> We need a more performant grid as part of the framework and my 
>> observations are these:
>> 1. We need two options for loading data:  all at once,  and server-side 
>> via ajax.  
>> 2. We need to fill the grid with complex queries,  including proper 'left 
>> join on' syntax,  and in-line selects.  We can then suppress all those 
>> magical data 'represents' queries which are all done with additional 
>> row-by-row sub-selects.  On one page of my sqlform.grid views it generated 
>> almost a hundred queries.  I was able to replace that with a single complex 
>> query.  
>> 3. Ideally,  we should avoid reloading the whole page when we want to 
>> edit the data.  For example,  using modal forms.
>>
>> Maybe I'm asking far too much.  However,  almost every app I write uses a 
>> data grid and associated create/edit forms.  In simple situations I am very 
>> grateful for the sqlform.grid.  In many other cases though,  I find myself 
>> writing similar code over and over to produce a more performant listing.  
>> With my ideal framework,  I cannot help but feel that I should have a 
>> better starting point.
>>
>> I know that I should try and bring solutions to this group rather than 
>> frustrations.  My suggestion is therefore: let's leverage something like 
>> Datatables!
>> If you got this far,  thanks for listening!
>>
>> Best regards.
>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/we

Re: [web2py] Re: web2py crashing

2017-08-01 Thread Kiran Subbaraman
Can you provide more details on the issue you see on a newer thread? The 
thread you are posting on is almost 5 years old, so the issue you may be 
facing may not be because of what is listed in this old thread. In any 
case, this is the code referenced in this old thread: 
https://github.com/web2py/web2py/blob/5d8a25626c4e6608e99b84bd25d2b88535430537/gluon/rocket.py#L1386


In your new post / new thread, can you share the following:
Some information on your environment: Which version of web2py, OS 
platform, python version, etc.
And do you see stack-traces in the log file / console? Then can you post 
that here.

Also, what do you mean by "reset rocket"?


Kiran Subbaraman
http://subbaraman.wordpress.com/about/

On 01-Aug-17 6:59 PM, Fabiano Faver wrote:
I got too many of this error lately. And its getting worse every day. 
I have no idea what to do to stop these errors. I have to reset rocket 
every few hours.
Was this fix eventually reverted ? Someone knows the file it is this 
workaround?



--
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: web2py crashing

2017-08-01 Thread Fabiano Faver
I got too many of this error lately. And its getting worse every day. I 
have no idea what to do to stop these errors. I have to reset rocket every 
few hours.
Was this fix eventually reverted ? Someone knows the file it is this 
workaround?


-- 
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: Weird problems generating menu from database

2017-08-01 Thread Вячеслав Анатольевич
I understood what was the matter, it was styling!
But, how to add the third field:

if auth.is_logged_in():
 rows = db(db.map).select(db.map.menu1, db.map.menu2, db.map.mnm_name, 
orderby=db.map.num, distinct=True)


 from collections import defaultdict
 d = defaultdict(list)
 for row in rows:
 d[row.menu1].append(row.menu2)


response.menu = [('Shema', True, URL('default'),[

[key, False, None, [[sub, False, None, [[sub, False, 'link']]] for sub in 
sorted(d[key])]] for key in sorted(d)])

]


in layout.html add style and js:


 
  .dropdown-submenu{position:relative;}
  
.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0
 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;}
  .dropdown-submenu:hover>.dropdown-menu{display:block;}
  .dropdown-submenu>a:after{display:block;content:" 
";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px
 0 5px 5px;border-left-color:#cc;margin-top:5px;margin-right:-10px;}
  .dropdown-submenu:hover>a:after{border-left-color:#ff;}
  
.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px
 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px;}






How to add db.map.mnm_name to row.menu2, somthing like that -  


d[row.menu1].append(row.menu2).append(db.map.mnm_name) (i know - that's is not 
working) 


?

-- 
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 type error reduce()

2017-08-01 Thread Paul Ellis
I am getting this error only when searching the auth_membership table

I have put in a basic 'appadmin' in my webapp. I call it 'tooladmin' to 
differentiate from the built in stuff.

I use this function to edit any database table:
def manage_table():
tablename = request.args(0)
pagetitle = H4('{0} {1}'.format(T('Manage'), tablename))
buttongroup = [_btn_index()]
table = db[tablename]
pagecontent = SQLFORM.grid(table, args=[request.args(0)])


response.view = 'tooladmin_core.html'
return dict(pagetitle=pagetitle, buttongroup=buttongroup, 
pagecontent=pagecontent)

The search feature on the SQLFORM.grid is throwing this error when 
searching the auth_membership table:

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

Traceback (most recent call last):
  File "E:\web2py\gluon\restricted.py", line 227, in restricted
exec ccode in environment
  File "E:/web2py/applications/OfferTool/controllers/tooladmin.py" 
, line 
262, in 
  File "E:\web2py\gluon\globals.py", line 417, in 
self._caller = lambda f: f()
  File "E:/web2py/applications/OfferTool/controllers/tooladmin.py" 
, line 
136, in manage_table
pagecontent = SQLFORM.grid(table, args=[request.args(0)])
  File "E:\web2py\gluon\sqlhtml.py", line 2526, in grid
subquery = SQLFORM.build_query(sfields, keywords)
  File "E:\web2py\gluon\sqlhtml.py", line 1827, in build_query
) for k in key.split()])
TypeError: reduce() of empty sequence with no initial value



-- 
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] grid show or hidden table coloumn

2017-08-01 Thread 黄祥
is it possible to show or hidden table coloumn in grid base on user choosen?

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.