Re: [web2py] use executesql results in grid

2014-04-14 Thread Johann Spies
On 14 April 2014 18:35, Yufei Li  wrote:

I am doing a quite complicated sql select with selects nested, which I do
> not know how to create using DAL, so I decided to go with executesql with
> fields specified. My questions is once I get back results of  'gluon.dal.Rows'> type, is there a way to create a SQLFORM.grid with them?
> I am able to use SQLTABLE, but I would lose the inline editing ability as
> suggested in
>
> http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript
>

What I do is to either create a database view or a table containing the
result and then in the controller define a model with 'migrate = False'  to
read the view/table and then use the grid on that view/table.  In order for
web2py to use that view/table easily I put something like 'id = 1'  in the
select and then make the id field 'readable=False'  in the controller.

Regards
Johann
-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

-- 
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] use executesql results in grid

2014-04-14 Thread Yufei Li
I am doing a quite complicated sql select with selects nested, which I do 
not know how to create using DAL, so I decided to go with executesql with 
fields specified. My questions is once I get back results of  type, is there a way to create a SQLFORM.grid with them? 
I am able to use SQLTABLE, but I would lose the inline editing ability as 
suggested in 
http://www.web2pyslices.com/slice/show/1928/basic-inline-editing-in-sqlformgrid-no-plugin-no-javascript

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] DAL: how to populate a (temporary) table from a Rows object without doing the iteration myself

2014-04-14 Thread Carson Little


In other words, I am looking for code like this:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from gluon import current
from gluon.dal import DAL, Field

db = DAL('sqlite://storage.db', lazy_tables=True)
db.define_table('mytable', Field('myfield'))

rows = fn_that_returns_a_list_or_Rows_object()
populate(db.mytable, rows) # a different version than gluon.contrib.populate


   - Will this populate() be easy to write?
   - Is there a populate() like the one I want already out there?

-- 
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] SSH Using jquery in Controller or View

2014-04-14 Thread codingerror3
I have a ssh code using javascript. I would like to know whether ssh for a 
remote server need to be done in view or controller ? I am using jquery 
because, I want to add remote machine to table and turn link into green / 
red based on remote server being active. I am completely new to web2py and 
now I am confused to weather I need to put ssh session in view or 
controller since I am using javascript ? Below is ssh code.

Thanks!

function ping(ip, callback) {


if (!this.inUse) {
this.status = 'unchecked';
this.inUse = true;
this.callback = callback;
this.ip = ip;
var _that = this;
this.img = new Image();
this.img.onload = function () {
_that.inUse = false;
_that.callback('responded');


};
this.img.onerror = function (e) {
if (_that.inUse) {
_that.inUse = false;
_that.callback('responded', e);
}


};
this.start = new Date().getTime();
this.img.src = "http://"; + ip;
this.timer = setTimeout(function () {
if (_that.inUse) {
_that.inUse = false;
_that.callback('timeout');
}
}, 1500);
}
}
var PingModel = function (servers) {
var self = this;
var myServers = [];
ko.utils.arrayForEach(servers, function (location) {
myServers.push({
name: location,
status: ko.observable('unchecked')
});
});
self.servers = ko.observableArray(myServers);
ko.utils.arrayForEach(self.servers(), function (s) {
s.status('checking');
new ping(s.name, function (status, e) {
s.status(status);
});
});
};

-- 
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: Networkx draw graph

2014-04-14 Thread Luis Fontes
Thank you very much Massimo. I will check if NetworkX can draw graphs 
without pyplot. Othercase
I will have to draw my graphs from scratch using Figure, Axis, etc.


On Monday, April 14, 2014 3:28:43 PM UTC+2, Massimo Di Pierro wrote:
>
> matplotlib has two API. A stateless and a statefull.
>
> The statefull mode is called matplotlib.pyplot and is it designed for 
> some compatibility with Matlab. Most of the examples posted are with 
> pyplot. The problem is that pyplot does not work for multithreaded web apps 
> because the state is in a global object instead of a local variable.
>
> You need to convert your example so that it does not use pyplot.
>
> I am not sure how to do it in your case but look how Canvas handles 
> Figure, Axis, and Plots without pyplot.
>
> Massimo
>
>
>
>
> On Sunday, 13 April 2014 12:32:05 UTC-5, Luis Fontes wrote:
>>
>> Thank you very much for your help Massimo.
>> The problem I have is not how to plot easily in matplotlib. My problem is 
>> how to display
>> in my web2py view the NetworkX drawing made using nx.draw without saving 
>> the png file in disk 
>> but using some code like:
>>
>> canvas=FigureCanvas(fig)
>> stream=cStringIO.StringIO()
>> canvas.print_png(stream)
>> return stream.getvalue()
>>
>> as I have seen in the web2py Application Development Cookbook and in 
>> your 
>> paper "web2py for Scientific Applications" (2011). 
>>
>> If you try for example:
>>
>> import matplotlib.pyplot as plt
>> import networkx as nx
>> G = nx.path_graph(21)
>> nx.draw(G)
>> plt.show()
>>
>> you get a plot. Now, how should I put this code in my model or controller 
>> to get 
>> the plot in my web2py view. 
>>
>> Thank you for your help.
>>
>>
>>
>>
>>
>>
>>  
>>
>> On Sunday, April 13, 2014 5:59:39 PM UTC+2, Massimo Di Pierro wrote:
>>>
>>> Not sure but look into https://github.com/mdipierro/canvas
>>>
>>> On Saturday, 12 April 2014 04:10:42 UTC-5, Luis Fontes wrote:

 I am trying to plot a graph using NetworkX draw function but 
 using cStringIO.StringIO(). I have read
 how to do it in web2py Application Development Cookbook.

 Let's say I have something like:

 import matplotlib.pyplot as plt
 import networkx as nx

 G = nx.path_graph(8)
 nx.draw(G)
 plt.show()

 This code plots and shows the graph. Now, to place it in a web2py view 
 I should use a function like:


 def mygraph()
 fig=Figure()

 .
 .
 .

 canvas=FigureCanvas(fig)
 stream=cStringIO.StringIO()
 canvas.print_png(stream)
 return stream.getvalue()

 The problem is how to place the plot generated by nx.path_graph(8) and 
 nx.draw(G) in the code in
 blue in order to make it work.

 I am learning web2py and I am nor expert in NetworkX or matplotlib 
 packages. Sorry if my question
 is stupid.

 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] possible issue (read bug) with web2py controllers parser

2014-04-14 Thread Massimo Di Pierro
Please open a ticket about this. I see the problem.

On Monday, 14 April 2014 14:45:07 UTC-5, Richard wrote:
>
> Hello,
>
> I had pretty weird issue with commented block of code. I was in the 
> process to migrate to 2.9.5 and I had code in controllers file that were 
> not executing at all. I have been searching for wild and finally discover 
> that I had leave an opening triple double quote in dash commented block of 
> code... Something like this :
>
> # Controllers
> # Begin
> def this_func_execute():
> return dict(a='Works!')
>
> # Commented block
> # Code with the triple double quotes """
>
>
> def this_func_not_execute():
> """This docstring is required for the issue to kickin!!"""
> return dict(a="I don't execute")
> # End
>
> Just copy the code above and than try to access the 
> "this_func_not_execute": not working. Try removing the docstring or the 
> triple double quotes and it works ok.
>
> Both are required for the issue to happen. If only the commented triple 
> double quote is there and no docstring in the following functions the issue 
> is not happening.
>
> Thanks
>
> Richard
>
>
>
>

-- 
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: Broken migration

2014-04-14 Thread Wonton
Oks, it's clear to me now. I'll change this. Thank you very much again!

On Monday, April 14, 2014 10:47:49 PM UTC+2, 黄祥 wrote:
>
> the the migrate settings is about the define_table affect on the database 
> side (migrate = True) and on the *.table files (fake_migrate=True). 
> there will be a little performance impact, but in terms of efficincy code 
> (because you only need to execute 1 time for create index). So let say 
> about study case in here, imagine that you have to use the other database 
> backend say mysql or postgresql, yet to create index is not support "IF NOT 
> EXIST", yet you will be 'check mate' in the case you put the CREATE INDEX 
> in the models. or put it simple just throw away IF NOT EXIST and keep it 
> with your SQLITE, you will got an error said the the index already created.
>
> 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: Why does appadmin have css overflow: hidden in database results?

2014-04-14 Thread User
Yes agree I did modify my own appadmin copy but I guess don't see why 
anyone would want the overflow auto in this context.  I understand it's for 
aesthetic but from my POV it's appadmin so this is not end users using it.  
My thinking was that if I'm annoyed by it others would be too and we should 
change the default as one drop in the bucket of making web2py better.


On Monday, April 14, 2014 9:16:34 AM UTC-4, Paolo Caruccio wrote:

> Now I see your POV. You are speaking about browser's scrollbars and not 
> about div content area scrollbars. The "overflow:auto" setting has been 
> applied to the container div of the result table for aestethic reasons 
> because such div should have a width of 80% but there is a bug in the code. 
> I will send a patch on web2py issue tracker.
> Anyway, if you are not confortable with "overflow:auto" and since appadmin 
> is a part of w2p application you can easily customize it by replacing the 
> line 68 in  /views/appadmin.html with a simple "". 
>
> Il giorno lunedì 14 aprile 2014 08:25:00 UTC+2, User ha scritto:
>>
>> Yes but with overflow:visible (the default css setting) there are no 
>> scroll bars and if the table has enough columns then the browser will show 
>> a horizontal scrollbar anyway as part of the browser window (as opposed to 
>> with auto showing the scrollbars as part of the div).  With "auto" It just 
>> gives the feeling of html frames which I thought most people agree are 
>> annoying except in limited circumstances.
>>
>> For me it just seems like overflow: auto is just an annoyance with no 
>> benefit, but I was wondering if there was something I was overlooking.  
>>
>> On Sunday, April 13, 2014 1:46:32 PM UTC-4, Paolo Caruccio wrote:
>>
>>> With overflow:auto the scrollbars (vertical and horizontal) are visible 
>>> only when it is necessary.
>>> Making scrollbars visible only when you need them is for aesthetic 
>>> reasons. Indeed not all the tables have a great number of columns. 
>>>
>>> Il giorno domenica 13 aprile 2014 13:32:41 UTC+2, User ha scritto:

 Sorry you're right it's auto not hidden that was a typo.  But why not 
 make it visible?

 On Sunday, April 13, 2014 5:37:53 AM UTC-4, Paolo Caruccio wrote:
>
> If you mean the view "*appadmin/select/db?query=your query"* actually 
> the table with the resulting rows is wrapped in a div with "
> overflow:auto".
> Therefore if you have more columns than the width of the browser a 
> horizontal scrollbar will be shown and the table will scroll 
> horizontally. 
> The horizontal scrollbar (that is managed by browser not by web2py) is 
> positioned after the last displayed row but you can scroll the table with 
> arrow keys on the keyboard.
> For the sake of completeness, if the div wrapper had "overflow:hidden" 
> you couldn't see any scrollbar.
> 
>
> Il giorno domenica 13 aprile 2014 03:01:35 UTC+2, User ha scritto:
>>
>> In appadmin, if I query a table that has more columns than the width 
>> of my browser there will be a horizontal scrollbar places on the div 
>> containing the database rows.  I find this annoying because in order to 
>> scroll horizontally I have to go to the bottom of the search results 
>> first 
>> to find the horizontal scrollbar and then scroll.
>>
>> If the containing div had overflow: visible then I could use the 
>> browser's horizontal scrollbar which is much more convenient.  My 
>> question 
>> is what purpose does having overflow = hidden serve in this context?
>>
>

-- 
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: Broken migration

2014-04-14 Thread 黄祥
the the migrate settings is about the define_table affect on the database 
side (migrate = True) and on the *.table files (fake_migrate=True). 
there will be a little performance impact, but in terms of efficincy code 
(because you only need to execute 1 time for create index). So let say 
about study case in here, imagine that you have to use the other database 
backend say mysql or postgresql, yet to create index is not support "IF NOT 
EXIST", yet you will be 'check mate' in the case you put the CREATE INDEX 
in the models. or put it simple just throw away IF NOT EXIST and keep it 
with your SQLITE, you will got an error said the the index already created.

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: great news: Sphinx Documentation

2014-04-14 Thread Cliff Kachinske
Thank you Niphlod.

You have done Yet Another Good Thing.

On Sunday, April 13, 2014 11:43:26 AM UTC-4, Massimo Di Pierro wrote:
>
> Great news! We are finally moving to Sphinx.
>
> http://web2py.readthedocs.org/en/latest/
>
> Kudos to Simone (niphlod) who single handedly ported all the docstrings 
> and made this possible.
>
> Thank you Simone!
>
>  
>

-- 
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] possible issue (read bug) with web2py controllers parser

2014-04-14 Thread Richard
Hello,

I had pretty weird issue with commented block of code. I was in the process 
to migrate to 2.9.5 and I had code in controllers file that were not 
executing at all. I have been searching for wild and finally discover that 
I had leave an opening triple double quote in dash commented block of 
code... Something like this :

# Controllers
# Begin
def this_func_execute():
return dict(a='Works!')

# Commented block
# Code with the triple double quotes """


def this_func_not_execute():
"""This docstring is required for the issue to kickin!!"""
return dict(a="I don't execute")
# End

Just copy the code above and than try to access the 
"this_func_not_execute": not working. Try removing the docstring or the 
triple double quotes and it works ok.

Both are required for the issue to happen. If only the commented triple 
double quote is there and no docstring in the following functions the issue 
is not happening.

Thanks

Richard



-- 
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] httpd internal 500 error -- out of the blue just from typing service httpd restart

2014-04-14 Thread Marco Mansilla
El Mon, 14 Apr 2014 11:28:25 -0700 (PDT)
LoveWeb2py  escribió:

> I've done this 100 times.
> 
> service httpd restart
> and it works fine
> 
> I am running web2py with python 2.7 and using the wsgihandler.py with 
> apache.
> 
> I've checked the error logs and it says 
> [warn] Init: Name-based SSL virtual hosts only work for clients with
> TLS server name indication support (RFC 4366)
> [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 
> mod_ssl/2.2.15 PHP/5.3.3 configured -- resuming normal operations
> 
> Are there any indicators here why I'm getting the 500 error? This is
> really killing me!! My server is down and no one can access the site
> please help!
> 

Not a good solution, but a temporary one... just reboot your server, I
have the same problem and so far couldn't find a solution... No
upgrade/update has been done in the server, this issue came up from
nowhere. 

Rebooting enables apache again, but if you want to restart the apache
service you'll have to restart the whole server.

Cheers.

-- 
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] httpd internal 500 error -- out of the blue just from typing service httpd restart

2014-04-14 Thread LoveWeb2py
Found out what the problem was. I upgraded my OpenSSL and only had 
permissions to access OpenSSL for apache. I installed it as root and wsgi 
tries to access one of the files in the OpenSSL folder (which was owned by 
root).

Once I changed ownership back to apache it started working again. However, 
now mysql doesn't work and i'm working on that. 

On Monday, April 14, 2014 11:57:33 AM UTC-4, marco mansilla wrote:
>
> El Mon, 14 Apr 2014 11:28:25 -0700 (PDT) 
> LoveWeb2py > escribió: 
>
> > I've done this 100 times. 
> > 
> > service httpd restart 
> > and it works fine 
> > 
> > I am running web2py with python 2.7 and using the wsgihandler.py with 
> > apache. 
> > 
> > I've checked the error logs and it says 
> > [warn] Init: Name-based SSL virtual hosts only work for clients with 
> > TLS server name indication support (RFC 4366) 
> > [notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 
> > mod_ssl/2.2.15 PHP/5.3.3 configured -- resuming normal operations 
> > 
> > Are there any indicators here why I'm getting the 500 error? This is 
> > really killing me!! My server is down and no one can access the site 
> > please help! 
> > 
>
> Not a good solution, but a temporary one... just reboot your server, I 
> have the same problem and so far couldn't find a solution... No 
> upgrade/update has been done in the server, this issue came up from 
> nowhere. 
>
> Rebooting enables apache again, but if you want to restart the apache 
> service you'll have to restart the whole server. 
>
> Cheers. 
>

-- 
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] httpd internal 500 error -- out of the blue just from typing service httpd restart

2014-04-14 Thread LoveWeb2py
I've done this 100 times.

service httpd restart
and it works fine

I am running web2py with python 2.7 and using the wsgihandler.py with 
apache.

I've checked the error logs and it says 
[warn] Init: Name-based SSL virtual hosts only work for clients with TLS 
server name indication support (RFC 4366)
[notice] Apache/2.2.15 (Unix) DAV/2 mod_wsgi/3.2 Python/2.6.6 
mod_ssl/2.2.15 PHP/5.3.3 configured -- resuming normal operations

Are there any indicators here why I'm getting the 500 error? This is really 
killing me!! My server is down and no one can access the site please 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] great news: Sphinx Documentation

2014-04-14 Thread Michele Comitini
Bravo Niphlod!  Looks really slick! besides being useful ;-)

2014-04-14 16:00 GMT+02:00 Richard Vézina :
> Simone BIG THANK YOU!!
>
> Richard
>
>
> On Mon, Apr 14, 2014 at 8:50 AM, Daniel Aguayo 
> wrote:
>>
>> On 13/04/14 12:43, Massimo Di Pierro wrote:
>>>
>>> Great news! We are finally moving to Sphinx.
>>>
>>> http://web2py.readthedocs.org/en/latest/
>>>
>>> Kudos to Simone (niphlod) who single handedly ported all the docstrings
>>> and made this possible.
>>>
>>> Thank you Simone!
>>>
>>>
>>
>> Awesome! This is very useful, Thank you niphold for your time
>>
>>
>> --
>> 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.

-- 
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: current trunk using memdb results in crash

2014-04-14 Thread Sebastian Cambeo
Sorry again the error is still there:

I opened an issue: 
https://code.google.com/p/web2py/issues/detail?id=1922&thanks=1922&ts=1397493893

-- 
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: Database compute fields

2014-04-14 Thread Anthony
On Monday, April 14, 2014 11:10:28 AM UTC-4, horridohobbyist wrote:
>
> Sonovagun, you're right! But that rather diminishes the usefulness of 
> 'compute', IMO.
>

Yes, though I suppose the alternative would add a lot of complexity (and 
potentially inefficiency). Maybe at least when .update_record is used it 
would make sense, given that the existing record is already there.

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: current trunk using memdb results in crash

2014-04-14 Thread Sebastian Cambeo
Sorry, never mind: I was on 2.9.4 and tried to reproduce it in latest trunk 
(Apparently it has been fixed since last month)

-- 
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] array with in the view

2014-04-14 Thread Multiplery
Hey Guys,

i have a few problems with the various view possibilities. The reference 
manual gives this piece of code as an example for the  in the view:

[code]
>>> print SELECT('', XML('world'), _class='test', _id=0) 
  world [/code]

when i just copy this into a view, nothing happens. Which parts of this 
does it need?

And the second part: assuming i have an array, for example filled with data 
out of an database, how can i create such an select function which contains 
all parts of the array as options?

Regards,

-- 
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: Database compute fields

2014-04-14 Thread horridohobbyist
Sonovagun, you're right! But that rather diminishes the usefulness of 
'compute', IMO.


On Monday, 14 April 2014 08:15:14 UTC-4, Anthony wrote:
>
> Yes, otherwise the DAL would have to do a db query to retrieve all the 
> records being updated and issue a separate update for each record (since 
> they may not all have the same price value and therefore might require 
> different updated values in the computed field).
>
> On Monday, April 14, 2014 7:09:07 AM UTC-4, horridohobbyist wrote:
>>
>> Are you saying I have to update the price field, regardless of whether it 
>> has changed or not?? That's not very logical.
>>
>>
>> On Sunday, 13 April 2014 18:39:51 UTC-4, Anthony wrote:
>>>
>>> I believe you have to provide the price field in your update as well.
>>
>>

-- 
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] great news: Sphinx Documentation

2014-04-14 Thread Richard Vézina
Simone BIG THANK YOU!!

Richard


On Mon, Apr 14, 2014 at 8:50 AM, Daniel Aguayo wrote:

> On 13/04/14 12:43, Massimo Di Pierro wrote:
>
>> Great news! We are finally moving to Sphinx.
>>
>> http://web2py.readthedocs.org/en/latest/
>>
>> Kudos to Simone (niphlod) who single handedly ported all the docstrings
>> and made this possible.
>>
>> Thank you Simone!
>>
>>
>>
> Awesome! This is very useful, Thank you niphold for your time
>
>
> --
> 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] Nginx/passenger/web2py -> 504 Gateway Timeout?

2014-04-14 Thread Richard Vézina
Use unicorn!!

Phusion is more work...

You can have a look in contrib there is a scrip that help deploy redmine
beside web2py with unicorn, so you can derive something for you need from
it. It works with 12.04.

Richard


On Sun, Apr 13, 2014 at 4:52 PM, Krzysztof Socha  wrote:

> I am trying to setup (vanila) web2py on shared hosting with nginx and
> passenger with support for python. I put all the files from web2py folder
> in the folder expected by passenger, I created a file passenger_wsgi.py
> required by passenger, which I simlinked to wsgihandler.py (taken from the
> handlers dir to the dir where web2py.py resides). The result: nothing works
> - I get consistently 504 Gateway Timeout for every attempted connection.
>
> On the other hand, when I simply created a passenger_wsgi.py file that
> contained:
>
> def application(environ, start_response):
>   start_response('200 OK', [('Content-Type', 'text/plain')])
>   return [b"hello world!\n"]
>
> then everything works fine - i.e., I get the "hello world".
>
> I believe, it takes about one minute for the request to time-out... Does
> the web2py startup take so long?  When can/should I do to make it work?
>
> Krzysztof.
>
>
>
>
>   start_response('200 OK', [('Content-Type', 'text/plain')])
>   return [b"hello world!\n"]
>
> def application(environ, start_response):
>   start_response('200 OK', [('Content-Type', 'text/plain')])
>   return [b"hello world!\n"]
>
> def application(environ, start_response):
>   start_response('200 OK', [('Content-Type', 'text/plain')])
>   return [b"hello world!\n"]
>
> def application(environ, start_response):
>   start_response('200 OK', [('Content-Type', 'text/plain')]) def 
> application(environ, start_response):
>
>   start_response('200 OK', [('Content-Type', 'text/plain')])
>   return [b"hello world!\n"]
>
>  --
> 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: Broken migration

2014-04-14 Thread Wonton
Hello and thank you very much for your answers.

stifan:

I thought that when you set migrate=False the content of db.py file was not 
executed, but obviously I was wrong. So, if I put the CREATE INDEX in a 
controller, the performance should be much better? 

pallav:

Thank you very much, I will take this into account the next time I have 
problems.

On Monday, April 14, 2014 8:05:10 AM UTC+2, pallav wrote:
>
> To use fake_migrate, first you have to revert your model definition to the 
> old version (that matches the existing db), run the app. This will make 
> web2py update the table definition file. Now, you can change your models 
> and set fake_migrate to False, and migrate to True.
>
> On Sunday, April 13, 2014 5:49:17 PM UTC-4, Wonton wrote:
>>
>> Hello!
>>
>> I have a web2py application with a sqlite database. The structure of my 
>> db.py file is something like this:
>>
>> db = DAL('sqlite://storage.sqlite', migrate=False)
>> ...
>> db.define_table('table1',
>> Field('field1'),
>> Field('field2'))
>> db.executesql('CREATE INDEX IF NOT EXISTS table1_field1 ON table1 
>> (field1)')
>>
>> db.define_table('table2',
>> Field('field1'),
>> Field('field2'))
>> db.executesql('CREATE INDEX IF NOT EXISTS table2_field1 ON table2 
>> (field1)')
>>
>> ...
>>
>> Each time I want to add a new table or a new field, I remove ", 
>> migrate=False", make the change and, after it has been applied I add ", 
>> migrate=False" again.
>> This has been working very well so far.
>>
>> Inside my database folder I have this files:
>> storage.sqlite
>> c8b1837fhj47blahblahblah_table1.table
>> c8b1837fhj47blahblahblah_table2.table
>>
>> Well, now my problem. Last time I made an update (I added a new table) in 
>> my database, the migration was broken. I don't know why but I guess it was 
>> probably because I removed accidentally the .table files and after restore 
>> them maybe they were too old. I tried everything and finally the migration 
>> worked and the database added the new table.
>>
>> Now my db.py file is something like this:
>>
>> db = DAL('sqlite://storage.sqlite', migrate=False)
>> ...
>> db.define_table('table1',
>> Field('field1'),
>> Field('field2'))
>> db.executesql('CREATE INDEX IF NOT EXISTS table1_field1 ON table1 
>> (field1)')
>>
>> db.define_table('table2',
>> Field('field1'),
>> Field('field2'))
>> db.executesql('CREATE INDEX IF NOT EXISTS table2_field1 ON table2 
>> (field1)')
>>
>> db.define_table('newtable',
>> Field('field1'))
>> db.executesql('CREATE INDEX IF NOT EXISTS newtable_field1 ON newtable 
>> (field1)')
>>
>> ...
>>
>> but the first strange thing, in my database folder now I have this:
>> storage.sqlite
>> c8b1837fhj47blahblahblah_table1.table
>> c8b1837fhj47blahblahblah_table2.table
>> newtable.table
>>
>> Why newtable.table doesn't have the c8b1837fhj47blahblahblah part? Is 
>> this important?
>>
>> The thing is that I need to add a new field to table1 table and I'm 
>> getting errors and I don't know how to solve them.
>>
>> Just removing the ", migrate=False" part I get the error "newtable is 
>> already defined" and the application fails.
>> I've tried to use db = DAL('sqlite://storage.sqlite', fake_migrate=True)and 
>> have no errors. Then I add my new field but no changes are applied to 
>> the database.
>>
>> What am i doing wrong? how could I fix this?
>>
>> Kind regards and thank you very much!
>>
>

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


[web2py] Re: current trunk using memdb results in crash

2014-04-14 Thread Massimo Di Pierro
Please open a ticket about this. Is this cachedb specific? Which page did 
you try it with?

On Monday, 14 April 2014 06:16:37 UTC-5, Sebastian Cambeo wrote:
>
> I just discovered a related issue:
> With session in memcache: Accessing a page repeatedly without being logged 
> in leads to a changing session_id on every request. This destroys the 
> purpose of a session_id completely... As far as I can see this is caused by 
> _try_store_in_db() which fails to lookup the session
>
> Am Montag, 14. April 2014 08:02:11 UTC+2 schrieb pallav:
>>
>> deleting memcache causes a separate issue (
>> https://code.google.com/p/web2py/issues/detail?id=1919) that you may be 
>> seeing.
>>
>> Basically, your browser now refers to a session that is not in memory 
>> anymore. Web2py looks for the missing key in memdb and crashes. Try 
>> clearing out your browser's sessions and cookies, this will disassociate 
>> your browser from the web2py session, and force the creation of a new 
>> session when you log in. You can also try using incognito mode in chrome to 
>> get a new session.
>>
>> On Friday, April 11, 2014 10:04:49 AM UTC-4, David Manns wrote:
>>>
>>> Tried this - didn't help
>>>
>>> On Thursday, April 10, 2014 5:17:38 PM UTC-4, Sebastian Cambeo wrote:

 Try deleting memcache and browser cache

 Am Donnerstag, 10. April 2014 21:13:39 UTC+2 schrieb David Manns:
>
> I am still seeing this in released version 2.9.5??
>
> On Sunday, March 9, 2014 9:04:49 PM UTC-4, Massimo Di Pierro wrote:
>>
>> This is fixed in trunk.
>>
>> On Friday, 7 March 2014 21:11:08 UTC-6, Leonardo Pires Felix wrote:
>>>
>>> Looks like that this is happening with the REDIS too, Upgraded from 
>>> 2.8.3 to 2.9.4 And the error persist.
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/restricted.py", 
>>> line 217, in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/leonardo/domains/cef03.com/arquivos/web2py/applications/cef03/models/db.py"
>>>  , line 62, in 
>>> 
>>> session.connect(request, response, db = sessiondb)
>>>   File 
>>> "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/globals.py", 
>>> line 883, in connect
>>> row = table(record_id, unique_key=unique_key)
>>> TypeError: __call__() got an unexpected keyword argument 'unique_key'
>>>
>>>
>>>
>>>
>>>
>>> Em terça-feira, 4 de março de 2014 19h37min17s UTC-3, Sebastian 
>>> Cambeo escreveu:

 I can only provide assistance for the "unique key error":
 line 883: 
 https://github.com/web2py/web2py/blame/master/gluon/globals.py:
 dee4e6a9
  
 »
  
 mdipierro  
 2013-08-20 new session logic 


 I don't know how the "int64 too big" error was introduced



 Am Dienstag, 4. März 2014 22:29:56 UTC+1 schrieb Massimo Di Pierro:
>
> can you provide a patch or a revision number that broke it?
>
> On Saturday, 1 March 2014 12:25:14 UTC-6, Bas Ti wrote:
>>
>> The current trunk does not support using memcache as session 
>> store on GAE:
>> session.connect calls memdb.Table.__call__(recordid, 
>> unique_key=unique_key)
>>
>> however unique_key is not supported by memdb.Table, it is only 
>> supported by dal.Table
>>
>

-- 
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: Networkx draw graph

2014-04-14 Thread Massimo Di Pierro
matplotlib has two API. A stateless and a statefull.

The statefull mode is called matplotlib.pyplot and is it designed for some 
compatibility with Matlab. Most of the examples posted are with pyplot. The 
problem is that pyplot does not work for multithreaded web apps because the 
state is in a global object instead of a local variable.

You need to convert your example so that it does not use pyplot.

I am not sure how to do it in your case but look how Canvas handles Figure, 
Axis, and Plots without pyplot.

Massimo




On Sunday, 13 April 2014 12:32:05 UTC-5, Luis Fontes wrote:
>
> Thank you very much for your help Massimo.
> The problem I have is not how to plot easily in matplotlib. My problem is 
> how to display
> in my web2py view the NetworkX drawing made using nx.draw without saving 
> the png file in disk 
> but using some code like:
>
> canvas=FigureCanvas(fig)
> stream=cStringIO.StringIO()
> canvas.print_png(stream)
> return stream.getvalue()
>
> as I have seen in the web2py Application Development Cookbook and in your 
> paper "web2py for Scientific Applications" (2011). 
>
> If you try for example:
>
> import matplotlib.pyplot as plt
> import networkx as nx
> G = nx.path_graph(21)
> nx.draw(G)
> plt.show()
>
> you get a plot. Now, how should I put this code in my model or controller 
> to get 
> the plot in my web2py view. 
>
> Thank you for your help.
>
>
>
>
>
>
>  
>
> On Sunday, April 13, 2014 5:59:39 PM UTC+2, Massimo Di Pierro wrote:
>>
>> Not sure but look into https://github.com/mdipierro/canvas
>>
>> On Saturday, 12 April 2014 04:10:42 UTC-5, Luis Fontes wrote:
>>>
>>> I am trying to plot a graph using NetworkX draw function but 
>>> using cStringIO.StringIO(). I have read
>>> how to do it in web2py Application Development Cookbook.
>>>
>>> Let's say I have something like:
>>>
>>> import matplotlib.pyplot as plt
>>> import networkx as nx
>>>
>>> G = nx.path_graph(8)
>>> nx.draw(G)
>>> plt.show()
>>>
>>> This code plots and shows the graph. Now, to place it in a web2py view I 
>>> should use a function like:
>>>
>>>
>>> def mygraph()
>>> fig=Figure()
>>>
>>> .
>>> .
>>> .
>>>
>>> canvas=FigureCanvas(fig)
>>> stream=cStringIO.StringIO()
>>> canvas.print_png(stream)
>>> return stream.getvalue()
>>>
>>> The problem is how to place the plot generated by nx.path_graph(8) and 
>>> nx.draw(G) in the code in
>>> blue in order to make it work.
>>>
>>> I am learning web2py and I am nor expert in NetworkX or matplotlib 
>>> packages. Sorry if my question
>>> is stupid.
>>>
>>> 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: SQLFORM.grid and custom edit form

2014-04-14 Thread Tim Price
And what about if I do want to create my own edit form from scratch? How do 
I get the 'edit' button on the SQLFORM.grid to link to my custom form?

On Friday, February 21, 2014 2:32:25 PM UTC+1, Anthony wrote:
>
> You can also customize the edit form created by the grid in the usual ways 
> (without creating your own form from scratch), including having custom view 
> code or specifying an alternative view altogether.
>
> Anthony
>
> On Friday, February 21, 2014 7:57:42 AM UTC-5, Luca Guerrieri wrote:
>>
>> Looks like it's my tie to post an answer :-))
>>
>> To customize the edit form or new form in a SQLFORM.grid i put in the 
>> controller, but exactly 
>> before the sqlform.grid creation and with a return ...
>>
>> if request.args(0) in ['edit']: 
>> response.flash=T("Edit form")
>> response.view = 'default/editclist.html' 
>> form = SQLFORM(db.mylist, db.mylist(request.args(2)))
>> if form.process().accepted:
>> response.flash = 'Update form accepted'
>> elif form.errors:
>> response.flash = 'Update form rejected, there are errors'
>> return dict(form=form)
>>
>> in this way I can have an edit or whatever i need ... customized ...
>> my custom view will be under default the editclist.html in which there 
>> will be a {{=form}}
>>
>>
>> p.s.: now I'm fighting with a links=links customization ... but this is 
>> another question :-))
>>  
>>
>> Il giorno giovedì 20 febbraio 2014 16:35:17 UTC+1, Luca Guerrieri ha 
>> scritto:
>>>
>>> Dear all,
>>> after some new things i have understood on web2py I'm not able to find 
>>> this solution :
>>>
>>> I've a sqlform.grid which becomes from a 2 tables query 
>>>
>>> ... some customization code 
>>>
>>> form = SQLFORM.grid(query=query, left = db.mylist.on(db.person.id == 
>>> db.mylist.name ) , field_id = (db.mylist.id), fields=fields, 
>>> headers=headers, orderby=default_sort_order, create=False, deletable=False, 
>>> editable=True, showbuttontext=False, maxtextlength=64, paginate=100, 
>>> user_signature=False, searchable = True, details = True)
>>>
>>>
>>>
>>> db.define_table('person',
>>> Field('name', 'string'),
>>> Field('dob', length=10),
>>> Field('address', 'text', length=255),
>>> Field('countryname'),
>>> )
>>>
>>> db.define_table('mylist',
>>> Field('object', 'string', length=6, required=True),
>>> Field('name', db.person),
>>> Field('zip', length=5, required=False),
>>> )
>>>
>>> When i click on the edit button related to a row (the pencil at the end 
>>> of every record row) , I would edit that values through a form on which i 
>>> can find 
>>> the values viewed in the row. That is possible for all the values become 
>>> from the first table (cardlist) but not for that become from the second 
>>> table (person)
>>>
>>> precisely i can read the ID of the second table but not the value 
>>> referred to 
>>> eg : editing the row I have a form with : object, zip and instead the 
>>> name of the person its id ...
>>>  
>>> There is a way to customize the edit form connected to the sqlform.grid 
>>> item ?
>>>
>>> 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: Why does appadmin have css overflow: hidden in database results?

2014-04-14 Thread Paolo Caruccio
Now I see your POV. You are speaking about browser's scrollbars and not 
about div content area scrollbars. The "overflow:auto" setting has been 
applied to the container div of the result table for aestethic reasons 
because such div should have a width of 80% but there is a bug in the code. 
I will send a patch on web2py issue tracker.
Anyway, if you are not confortable with "overflow:auto" and since appadmin 
is a part of w2p application you can easily customize it by replacing the 
line 68 in  /views/appadmin.html with a simple "". 

Il giorno lunedì 14 aprile 2014 08:25:00 UTC+2, User ha scritto:
>
> Yes but with overflow:visible (the default css setting) there are no 
> scroll bars and if the table has enough columns then the browser will show 
> a horizontal scrollbar anyway as part of the browser window (as opposed to 
> with auto showing the scrollbars as part of the div).  With "auto" It just 
> gives the feeling of html frames which I thought most people agree are 
> annoying except in limited circumstances.
>
> For me it just seems like overflow: auto is just an annoyance with no 
> benefit, but I was wondering if there was something I was overlooking.  
>
> On Sunday, April 13, 2014 1:46:32 PM UTC-4, Paolo Caruccio wrote:
>
>> With overflow:auto the scrollbars (vertical and horizontal) are visible 
>> only when it is necessary.
>> Making scrollbars visible only when you need them is for aesthetic 
>> reasons. Indeed not all the tables have a great number of columns. 
>>
>> Il giorno domenica 13 aprile 2014 13:32:41 UTC+2, User ha scritto:
>>>
>>> Sorry you're right it's auto not hidden that was a typo.  But why not 
>>> make it visible?
>>>
>>> On Sunday, April 13, 2014 5:37:53 AM UTC-4, Paolo Caruccio wrote:

 If you mean the view "*appadmin/select/db?query=your query"* actually 
 the table with the resulting rows is wrapped in a div with "
 overflow:auto".
 Therefore if you have more columns than the width of the browser a 
 horizontal scrollbar will be shown and the table will scroll horizontally. 
 The horizontal scrollbar (that is managed by browser not by web2py) is 
 positioned after the last displayed row but you can scroll the table with 
 arrow keys on the keyboard.
 For the sake of completeness, if the div wrapper had "overflow:hidden" 
 you couldn't see any scrollbar.
 

 Il giorno domenica 13 aprile 2014 03:01:35 UTC+2, User ha scritto:
>
> In appadmin, if I query a table that has more columns than the width 
> of my browser there will be a horizontal scrollbar places on the div 
> containing the database rows.  I find this annoying because in order to 
> scroll horizontally I have to go to the bottom of the search results 
> first 
> to find the horizontal scrollbar and then scroll.
>
> If the containing div had overflow: visible then I could use the 
> browser's horizontal scrollbar which is much more convenient.  My 
> question 
> is what purpose does having overflow = hidden serve in this context?
>


-- 
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: Garbled html in online book!?

2014-04-14 Thread Michele Comitini
thank you Seeker.
The cache must have some problem if it taking so long.

2014-04-14 15:04 GMT+02:00 Seeker :
> Nope, I have also reported it:
> https://groups.google.com/forum/?fromgroups#!topic/web2py/0hEVdXMY6BE
>
> I think Tim did try to fix it, but the cache seems to be the problem now.
>
>
>
> On Monday, 14 April 2014 14:59:36 UTC+2, Michele Comitini wrote:
>>
>> It's only me?
>>
>> See a few lines below this anchor:
>>
>> http://www.web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables
>>
>> mic
>
> --
> 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: Garbled html in online book!?

2014-04-14 Thread Seeker
Nope, I have also reported it:
https://groups.google.com/forum/?fromgroups#!topic/web2py/0hEVdXMY6BE

I think Tim did try to fix it, but the cache seems to be the problem now.



On Monday, 14 April 2014 14:59:36 UTC+2, Michele Comitini wrote:
>
> It's only me? 
>
> See a few lines below this anchor: 
>
> http://www.web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables
>  
>
> mic 
>

-- 
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] Garbled html in online book!?

2014-04-14 Thread Michele Comitini
It's only me?

See a few lines below this anchor:
http://www.web2py.com/books/default/chapter/29/09/access-control#Renaming-Auth-tables

mic

-- 
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] great news: Sphinx Documentation

2014-04-14 Thread Daniel Aguayo

On 13/04/14 12:43, Massimo Di Pierro wrote:

Great news! We are finally moving to Sphinx.

http://web2py.readthedocs.org/en/latest/

Kudos to Simone (niphlod) who single handedly ported all the docstrings
and made this possible.

Thank you Simone!




Awesome! This is very useful, Thank you niphold for your time

--
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: What does this timeout error in pg8000 mean?

2014-04-14 Thread Mobility
Thanks Derek

I changed the driver to psycopg2 and since then I got no problems. Mariano 
Reingart gave this advice. I would recommend that everybody use psycopg2 in 
deployment.

Thanks.

Em sábado, 5 de abril de 2014 10h13min06s UTC-3, Mobility escreveu:
>
>
> Versionweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 
> 2.7.5: /usr/bin/python (prefix: 
> /System/Library/Frameworks/Python.framework/Versions/2.7)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
> 26.
> 27.
>
> Traceback (most recent call last):
>   File "/Library/Server/web2py/gluon/main.py", line 539, in wsgibase
> BaseAdapter.close_all_instances('rollback')
>   File "/Library/Server/web2py/gluon/dal.py", line 600, in close_all_instances
> db._adapter.close(action)
>   File "/Library/Server/web2py/gluon/dal.py", line 580, in close
> getattr(self, action)()
>   File "/Library/Server/web2py/gluon/dal.py", line 1923, in rollback
> return self.connection.rollback()
>   File "/Library/Server/web2py/gluon/contrib/pg8000/dbapi.py", line 455, in 
> _fn
> return fn(self, *args, **kwargs)
>   File "/Library/Server/web2py/gluon/contrib/pg8000/dbapi.py", line 551, in 
> rollback
> self.conn.rollback()
>   File "/Library/Server/web2py/gluon/contrib/pg8000/interface.py", line 622, 
> in rollback
> self._rollback.execute()
>   File "/Library/Server/web2py/gluon/contrib/pg8000/interface.py", line 166, 
> in execute
> self.c.close_portal(self._portal_name)
>   File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1326, 
> in close_portal
> reader.handle_messages()
>   File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 906, 
> in handle_messages
> msg = self._conn._read_message()
>   File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1033, 
> in _read_message
> bytes = self._read_bytes(5)
>   File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1021, 
> in _read_bytes
> self._sock_buf = self._sock.recv(1024)
> timeout: timed 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: great news: Sphinx Documentation

2014-04-14 Thread Gour
Massimo Di Pierro
 writes:

> Great news! We are finally moving to Sphinx.

Very nice!!

Does it mean the web2py book will also move to reST/Sphinx and/or more
support for using reST within web2py?


Sincerely,
Gour

-- 
One who restrains his senses, keeping them under full control, 
and fixes his consciousness upon Me, is known as a man of 
steady intelligence.

-- 
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: Database compute fields

2014-04-14 Thread Anthony
Yes, otherwise the DAL would have to do a db query to retrieve all the 
records being updated and issue a separate update for each record (since 
they may not all have the same price value and therefore might require 
different updated values in the computed field).

On Monday, April 14, 2014 7:09:07 AM UTC-4, horridohobbyist wrote:
>
> Are you saying I have to update the price field, regardless of whether it 
> has changed or not?? That's not very logical.
>
>
> On Sunday, 13 April 2014 18:39:51 UTC-4, Anthony wrote:
>>
>> I believe you have to provide the price field in your update as well.
>
>

-- 
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: great news: Sphinx Documentation

2014-04-14 Thread villas
Thanks Niphlod,  this is great!


On Sunday, 13 April 2014 16:43:26 UTC+1, Massimo Di Pierro wrote:
>
> Great news! We are finally moving to Sphinx.
>
> http://web2py.readthedocs.org/en/latest/
>
> Kudos to Simone (niphlod) who single handedly ported all the docstrings 
> and made this possible.
>
> Thank you Simone!
>
>  
>

-- 
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: Online Manual: Chapter 9: Access Control - Formatting/content issues?

2014-04-14 Thread Seeker
Hi Tim,

Any idea how long it will take for caches to clear?  The problem still 
persists :-|



On Friday, 11 April 2014 06:40:58 UTC+2, Tim Richardson wrote:
>
> it;s been fixed ... just waiting for caches to clear, I think.
>
> On Friday, 11 April 2014 00:03:39 UTC+10, DenesL wrote:
>>
>>
>> True, everything after "9.1.5 Renaming Auth tables" is corrupted.
>>
>>
>> On Thursday, April 10, 2014 5:58:58 AM UTC-4, Seeker wrote:
>>>
>>> Hi,
>>>
>>> Is it just me (and my lack of appropriate knowledge) or is there 
>>> something wrong with chapter 9 of the book?
>>> The text starts off well, but about halfway down the page the formatting 
>>> seems jumbled and there seems to be some info missing as well.
>>>
>>> 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: current trunk using memdb results in crash

2014-04-14 Thread Sebastian Cambeo
I just discovered a related issue:
With session in memcache: Accessing a page repeatedly without being logged 
in leads to a changing session_id on every request. This destroys the 
purpose of a session_id completely... As far as I can see this is caused by 
_try_store_in_db() which fails to lookup the session

Am Montag, 14. April 2014 08:02:11 UTC+2 schrieb pallav:
>
> deleting memcache causes a separate issue (
> https://code.google.com/p/web2py/issues/detail?id=1919) that you may be 
> seeing.
>
> Basically, your browser now refers to a session that is not in memory 
> anymore. Web2py looks for the missing key in memdb and crashes. Try 
> clearing out your browser's sessions and cookies, this will disassociate 
> your browser from the web2py session, and force the creation of a new 
> session when you log in. You can also try using incognito mode in chrome to 
> get a new session.
>
> On Friday, April 11, 2014 10:04:49 AM UTC-4, David Manns wrote:
>>
>> Tried this - didn't help
>>
>> On Thursday, April 10, 2014 5:17:38 PM UTC-4, Sebastian Cambeo wrote:
>>>
>>> Try deleting memcache and browser cache
>>>
>>> Am Donnerstag, 10. April 2014 21:13:39 UTC+2 schrieb David Manns:

 I am still seeing this in released version 2.9.5??

 On Sunday, March 9, 2014 9:04:49 PM UTC-4, Massimo Di Pierro wrote:
>
> This is fixed in trunk.
>
> On Friday, 7 March 2014 21:11:08 UTC-6, Leonardo Pires Felix wrote:
>>
>> Looks like that this is happening with the REDIS too, Upgraded from 
>> 2.8.3 to 2.9.4 And the error persist.
>>
>> Traceback (most recent call last):
>>   File 
>> "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/restricted.py", 
>> line 217, in restricted
>> exec ccode in environment
>>   File 
>> "/home/leonardo/domains/cef03.com/arquivos/web2py/applications/cef03/models/db.py"
>>  , line 62, in 
>> 
>> session.connect(request, response, db = sessiondb)
>>   File 
>> "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/globals.py", 
>> line 883, in connect
>> row = table(record_id, unique_key=unique_key)
>> TypeError: __call__() got an unexpected keyword argument 'unique_key'
>>
>>
>>
>>
>>
>> Em terça-feira, 4 de março de 2014 19h37min17s UTC-3, Sebastian 
>> Cambeo escreveu:
>>>
>>> I can only provide assistance for the "unique key error":
>>> line 883: 
>>> https://github.com/web2py/web2py/blame/master/gluon/globals.py:
>>> dee4e6a9
>>>  
>>> »
>>>  
>>> mdipierro  
>>> 2013-08-20 new session logic 
>>>
>>>
>>> I don't know how the "int64 too big" error was introduced
>>>
>>>
>>>
>>> Am Dienstag, 4. März 2014 22:29:56 UTC+1 schrieb Massimo Di Pierro:

 can you provide a patch or a revision number that broke it?

 On Saturday, 1 March 2014 12:25:14 UTC-6, Bas Ti wrote:
>
> The current trunk does not support using memcache as session store 
> on GAE:
> session.connect calls memdb.Table.__call__(recordid, 
> unique_key=unique_key)
>
> however unique_key is not supported by memdb.Table, it is only 
> supported by dal.Table
>


-- 
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: Database compute fields

2014-04-14 Thread horridohobbyist
Are you saying I have to update the price field, regardless of whether it 
has changed or not?? That's not very logical.


On Sunday, 13 April 2014 18:39:51 UTC-4, Anthony wrote:
>
> I believe you have to provide the price field in your update as well.

-- 
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] autodelete(?) on computed field

2014-04-14 Thread Marin Pranjić
db.define_table(...,
  Field('image', 'upload', autodelete=True),
  Field('thumbnail', 'upload', autodelete=True, compute=create_thumbnail),
 ...)

This is not working because on _before_update/_before_delete callbacks 
thumbnail is not one of the upload_fields.
I am talking about delete_uploaded_files defined inside gluon/dal.py.

Is there an easier way or I have to manually do the code?

Marin

-- 
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] great news: Sphinx Documentation

2014-04-14 Thread Johann Spies
Thanks!


On 14 April 2014 02:44, Brian M  wrote:

> Great job niphlod!
>
> --
> 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.
>



-- 
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)

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