[web2py] Re: GAE users… help

2012-10-02 Thread howesc
i added a comment to the ticket.  GAE deprecated that some time ago and we 
just didn't keep up.  looks like it is updated in trunk.

cfh

On Monday, October 1, 2012 6:58:08 PM UTC-7, Massimo Di Pierro wrote:
>
> What about this ticket?
>
> http://code.google.com/p/web2py/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Priority%20Milestone%20Owner%20Summary%20Modified&groupby=&sort=-modified&id=990
>
> Massimo
>

-- 





Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-02 Thread Massimo Di Pierro
Please open a ticket your your proposal and the link. This is a serious 
possibility!
Can the monolitic build be automated?

On Tuesday, 2 October 2012 20:12:41 UTC-5, Ricardo Pedroso wrote:
>
> On Mon, Oct 1, 2012 at 11:28 PM, Massimo Di Pierro 
> > wrote: 
> > Does it support ssl? 
>
> Yes. 
>
> > We need to benchmark it for non-linux environments. Also I am not sure 
> about 
> > the PycURL dependence for python2.5. 
>
> PycURL is only need for the http client part, to act as a server, 
> there is no need. 
>
>
> > Can you send us instructions to build a single-file tornado server? 
>
> As I said, once I did a single-file build of tornado 1.2.1. 
> It wasn't an automatic build with some script magic, but instead, 
> was made by hand and was surprisingly easy to join the essential parts. 
>
>
> Today I look at tornado and they are in version 2.4. So I spend some 
> time rebuild 
> the single-file tornado. It was easier and smaller with version 1.2, 
> but it is still easy. 
>
> I put it on github (https://github.com/rpedroso/motor) with some 
> instrutions. 
>
>
> It was tested only in Linux, so may work (I hope) or not for others 
> systems. 
>
> I put the results of two ab benchmarks in the README 
> (rocket vs monolithic tornado) of web2py trunk 
>
>
> Ricardo 
>
>
> > On Monday, 1 October 2012 16:27:11 UTC-5, Ricardo Pedroso wrote: 
> >> 
> >> On Sun, Sep 30, 2012 at 6:43 PM, Massimo Di Pierro 
> >>  wrote: 
> >> > We can only package pure python web servers. Tornado does not meet 
> this 
> >> > requirement. 
> >> 
> >> 
> >> Tornado is pure Python and very fast - and even much faster with PyPy. 
> >> 
> >> It only has an optional C module for those who want to use epoll on 
> >> Linux/Python2.5, 
> >> if this module is not available it will use select, this is the logic 
> >> in tornado at the end of ioloop.py: 
> >> 
> >> # Choose a poll implementation. Use epoll if it is available, fall back 
> to 
> >> # select() for non-Linux platforms 
> >> if hasattr(select, "epoll"): 
> >> # Python 2.6+ on Linux 
> >> _poll = select.epoll 
> >> elif hasattr(select, "kqueue"): 
> >> # Python 2.6+ on BSD or Mac 
> >> _poll = _KQueue 
> >> else: 
> >> try: 
> >> # Linux systems with our C module installed 
> >> import epoll 
> >> _poll = _EPoll 
> >> except Exception: 
> >> # All other systems 
> >> import sys 
> >> if "linux" in sys.platform: 
> >> logging.warning("epoll module not found; using select()") 
> >> _poll = _Select 
> >> 
> >> It can be put in a single py module. I once did it with tornado 
> >> version 1.2.1 and if I recall the size 
> >> was around 40/50k of code 
> >> 
> >> The big difference with rocket is that it's not a threaded server. The 
> >> recommended way is running 
> >> one instance per CPU - this can be handled automatically by tornado. 
> >> 
> >> Ricardo 
> > 
> > -- 
> > 
> > 
> > 
>

-- 





Re: [web2py] Re: symmetric key encryption using PyCrypto

2012-10-02 Thread Dave
Potentially.

The way that I am storing the encrypted data is pretty standard.  16 byte 
IV at the head of the encrypted data.  It should be fairly compatible.  I 
have never looked at slowAES personally.

My reason for creating this was to facilitate symmetric encryption of 
arbitrary data in my app but keeping the encryption in the app so as to not 
be tied to a particular data store.  Some databases allow field level 
encryption but I feel better about doing the encryption in the app and 
storing the base64 encoded encrypted byte data as a string.


On Wednesday, October 3, 2012 12:21:10 AM UTC-4, Jonathan Lundell wrote:
>
> On 2 Oct 2012, at 8:51 PM, Dave > wrote:
>
> Sorry...  there was supposed to be a 2 as well... i was making a numbered 
> list.  These days my brain is not functioning as well as I would like given 
> my health.
>
> My utility class does in fact use PyCrypto.  What I was saying is PyCrypto 
> has to be compiled on the host it is being run on because it has C in it. 
>  It's not native Python.  I wonder though, it may be possible to get our 
> hands on the modified source that Google has compiled in the GAE platform. 
>  That version would be pure python without IDEA.  
>
>
> Export restrictions aside, a possible approach would be to have a wrapper 
> that works with (say) SlowAES, but uses PyCrypto if available.
>
>
> Attached is the file.  Keep in mind that it will require a secret key 
> exactly 256 bits or 32 bytes long.
>
>
> My intent is to cache the Class to prevent overhead and file locking 
> issues reading the secret file every time I need encryption.  I understand 
> that there is risk to having the key in memory, but reading a file for 
> every crypt or decrypt is silly.  There are far better ways for securing 
> the secret key.  This is just an example.  
>
> Enjoy.
>
> On Monday, October 1, 2012 8:21:19 PM UTC-4, Massimo Di Pierro wrote:
>>
>> Not sure I understand. Does your library uses PyCrypto or not? What do 
>> you mean "due to 1"?
>> Anyway, I would like to see it.
>>
>> Massimo
>>
>> On Monday, 1 October 2012 17:15:51 UTC-5, Dave wrote:
>>>
>>> I wanted to post to the group that I have created a utility class for 
>>> performing encryption and decryption using the PyCrypto library.  It really 
>>> can't be baked in to web2py due to 1, export restrictions, but also the 
>>> underlying PyCrypto library is not pure python.  There is some optimized C 
>>> in the library.
>>>
>>> If anybody is interested, I can clean up the code, remove some of my 
>>> more "trade secret" stuff and share it.  If you are hosting on GAE, you may 
>>> use PyCrpyto, but there are caveats.  PGP and IDEA crpyt modules are not 
>>> there due to licensing.  Furthermore PKI operations are re-written by 
>>> Google in pure python instead of optimized, faster C.  This is due to their 
>>> security policy.
>>>
>>> My utility class uses AES and the CFB mode.
>>>
>>> cheers
>>>
>>
> -- 
>  
>  
>  
> 
>
>
>
>

-- 





[web2py] APP-specific routers

2012-10-02 Thread lyn2py
The new (or maybe not so new, by now) app-specific routers is an excellent 
idea. I love it. 

Can I get some help regarding the use of it?

The following code is in my routes.py file, but it doesn't seem to work:
routers = {
app: dict(
default_language = possible_languages['default'][0],
languages = [lang for lang in possible_languages
   if lang != 'default'],
default_controller = 'default', #I added this
default_function = 'index', #and this
)
}
I added the two lines but it isn't working. (per the comments)
I have tried both reloading routes and restarting the server.
Is the syntax incorrect? Thanks!

-- 





Re: [web2py] Re: symmetric key encryption using PyCrypto

2012-10-02 Thread Jonathan Lundell
On 2 Oct 2012, at 8:51 PM, Dave  wrote:
> Sorry...  there was supposed to be a 2 as well... i was making a numbered 
> list.  These days my brain is not functioning as well as I would like given 
> my health.
> 
> My utility class does in fact use PyCrypto.  What I was saying is PyCrypto 
> has to be compiled on the host it is being run on because it has C in it.  
> It's not native Python.  I wonder though, it may be possible to get our hands 
> on the modified source that Google has compiled in the GAE platform.  That 
> version would be pure python without IDEA.  

Export restrictions aside, a possible approach would be to have a wrapper that 
works with (say) SlowAES, but uses PyCrypto if available.

> 
> Attached is the file.  Keep in mind that it will require a secret key exactly 
> 256 bits or 32 bytes long.
> 
> 
> My intent is to cache the Class to prevent overhead and file locking issues 
> reading the secret file every time I need encryption.  I understand that 
> there is risk to having the key in memory, but reading a file for every crypt 
> or decrypt is silly.  There are far better ways for securing the secret key.  
> This is just an example.  
> 
> Enjoy.
> 
> On Monday, October 1, 2012 8:21:19 PM UTC-4, Massimo Di Pierro wrote:
> Not sure I understand. Does your library uses PyCrypto or not? What do you 
> mean "due to 1"?
> Anyway, I would like to see it.
> 
> Massimo
> 
> On Monday, 1 October 2012 17:15:51 UTC-5, Dave wrote:
> I wanted to post to the group that I have created a utility class for 
> performing encryption and decryption using the PyCrypto library.  It really 
> can't be baked in to web2py due to 1, export restrictions, but also the 
> underlying PyCrypto library is not pure python.  There is some optimized C in 
> the library.
> 
> If anybody is interested, I can clean up the code, remove some of my more 
> "trade secret" stuff and share it.  If you are hosting on GAE, you may use 
> PyCrpyto, but there are caveats.  PGP and IDEA crpyt modules are not there 
> due to licensing.  Furthermore PKI operations are re-written by Google in 
> pure python instead of optimized, faster C.  This is due to their security 
> policy.
> 
> My utility class uses AES and the CFB mode.
> 
> cheers
> 
> -- 
>  
>  
>  
> 


-- 





[web2py] Re: symmetric key encryption using PyCrypto

2012-10-02 Thread Dave
Sorry...  there was supposed to be a 2 as well... i was making a numbered 
list.  These days my brain is not functioning as well as I would like given 
my health.

My utility class does in fact use PyCrypto.  What I was saying is PyCrypto 
has to be compiled on the host it is being run on because it has C in it. 
 It's not native Python.  I wonder though, it may be possible to get our 
hands on the modified source that Google has compiled in the GAE platform. 
 That version would be pure python without IDEA.  

Attached is the file.  Keep in mind that it will require a secret key 
exactly 256 bits or 32 bytes long.


My intent is to cache the Class to prevent overhead and file locking issues 
reading the secret file every time I need encryption.  I understand that 
there is risk to having the key in memory, but reading a file for every 
crypt or decrypt is silly.  There are far better ways for securing the 
secret key.  This is just an example.  

Enjoy.

On Monday, October 1, 2012 8:21:19 PM UTC-4, Massimo Di Pierro wrote:
>
> Not sure I understand. Does your library uses PyCrypto or not? What do you 
> mean "due to 1"?
> Anyway, I would like to see it.
>
> Massimo
>
> On Monday, 1 October 2012 17:15:51 UTC-5, Dave wrote:
>>
>> I wanted to post to the group that I have created a utility class for 
>> performing encryption and decryption using the PyCrypto library.  It really 
>> can't be baked in to web2py due to 1, export restrictions, but also the 
>> underlying PyCrypto library is not pure python.  There is some optimized C 
>> in the library.
>>
>> If anybody is interested, I can clean up the code, remove some of my more 
>> "trade secret" stuff and share it.  If you are hosting on GAE, you may use 
>> PyCrpyto, but there are caveats.  PGP and IDEA crpyt modules are not there 
>> due to licensing.  Furthermore PKI operations are re-written by Google in 
>> pure python instead of optimized, faster C.  This is due to their security 
>> policy.
>>
>> My utility class uses AES and the CFB mode.
>>
>> cheers
>>
>

-- 



#!/usr/bin/env python
# coding: utf8

"""
   Crpytography Functions
   authors:Dave Stoll 
   Jason Burosh 
"""
from Crypto.Cipher import AES
from Crypto import Random
import base64, os

class SjCrypt(object):
BLOCK_SIZE = 16
MODE = AES.MODE_CFB

def __init__(self, request=None):
"""
Default constructor for use in web2py.
Set up system-wide symmetric encryption key
"""
if request:
filename = os.path.join(request.folder,'private','encryption.secret')
if not os.path.exists(filename): 
key = Random.get_random_bytes(32)
open(filename,'w').write(key)
self.secret = open(filename,'r').read().strip()
else:
# this is only for testing.  Random key... do NOT use this way
self.secret = Random.get_random_bytes(32)

def crypt(self, inmsg):
"""
encryption method.

crypt(string message)
Returns a base64 encoded encrypted text
"""

# first set up the initialization vector
# this should be done for each encryption
iv=Random.get_random_bytes(self.BLOCK_SIZE)

# now get a cipher object.
# very important to do this each time you call crypt or decrypt
c = AES.new(self.secret, self.MODE, iv)

#encrypt the incoming message
msg = c.encrypt(inmsg)

#prepend the IV to the msg
encrypted_bytes=iv+msg

#return the base64 encoded string
return base64.urlsafe_b64encode(encrypted_bytes)

def decrypt(self, inmsg):
"""
decryption method.

decrypt(string message)
Takes a base64.urlsafe_b64encoded string as the only argument

return the decrypted string
"""

# first we must decode the incoming message
encrypted_bytes = base64.urlsafe_b64decode(inmsg)

# next split the incoming message to obtain iv and data
# the IV is the first BLOCK_SIZE bytes
iv, msg = (encrypted_bytes[:self.BLOCK_SIZE], encrypted_bytes[self.BLOCK_SIZE:])

# now get a cipher object.
# very important to do this each time you call crypt or decrypt
c = AES.new(self.secret, self.MODE, iv)

# decrypt the message and return it all together
return c.decrypt(msg)


def test():
"""
this will test the class
"""
print 'Testing cryptography'
msg = 'the british are coming'

c = SjCrypt()
print "msg before encryption: " + msg

crypted = c.crypt(msg)
print "encrypted message: " + crypted

decrypted = c.decrypt(crypted)
print "decrypted message: " + decrypted

assert(msg == decrypted), "Decrypted message does not match original."
pri

[web2py] Re: Need help... testing new DAL

2012-10-02 Thread Matt
Just testing it now, Getting an error on GAE + CloudSQL:

 File "/Projects/www//applications/app/models/db.py", line 45, in 
auth.define_tables()
  File "/Projects/www/gluon/tools.py", line 1506, in define_tables
format='%(first_name)s %(last_name)s (%(id)s)'))
  File "/Projects/www/gluon/dal.py", line 7050, in define_table
table = self.lazy_define_table(tablename,*fields,**args)
  File "/Projects/www/gluon/dal.py", line 7081, in lazy_define_table
polymodel=polymodel)
  File "/Projects/www/gluon/dal.py", line 935, in create_table
self.file_close(tfile)
  File "/Projects/www/gluon/dal.py", line 4005, in file_close
fileobj.close()
AttributeError: DatabaseStoredFile instance has no attribute 'close'

Matt

On Tuesday, October 2, 2012 3:32:16 PM UTC+13, Massimo Di Pierro wrote:
>
> There is a big change in DAL.
>
> a = DAL(uri)
> b = DAL(uri)
>
> now "a is b" because DAL is a singleton (almost). It is a thread local 
> singleton as long a uri is specified.
> What does this mean in practice?
>
> It means that unless you have lazy virtual fields, Row and Rows objects 
> can be serialized (pickled), properly cached, and stored in session.
> For example:
>
> session.rows = session.rows or db(db.mytable).select()
>
> and you can still do:
>
> session.rows.first().update_record()
>
> has many practical implications in the way you program and there is even 
> more we could do. In the future we may be able to serialize every DAL 
> expression.
>
> This is a big change in the source and the internal logic is complex. 
> It may have some unforeseen side effects.
> PLEASE TEST THAT TRUNK DOES NOT BREAK YOUR CODE before this makes it into 
> stable.
>
> massimo
>
>
>
>
>
>

-- 





[web2py] Re: cron not work in 2.0.9

2012-10-02 Thread Márcio
Massimo, help please.

-- 





Re: [web2py] Re: powerTable AttributeError: 'DAL' object has no attribute 'virtual'

2012-10-02 Thread tomt
I also have been having the same issue.  I'm running web2py 2.0.9
I only have one db = DAL statement.
All of my DAL is in models/db.py.  I don't have any files in the modules 
directory.
I haven't specifically stored a rows object in session, although the 
controller does have a couple of the following statements.
if form.accepts(request.vars,session, dbio=False):


On Monday, October 1, 2012 3:05:34 PM UTC-6, Massimo Di Pierro wrote:
>
> Are you storing a rows object in a session? Do you have DAL in modules 
> instead of models? Do you have multiple db=DAL() statements?
>
> On Monday, 1 October 2012 14:33:29 UTC-5, Wes Hall wrote:
>>
>> I have been having the same issue and was able to try trunk just now.
>>
>> The error persists.
>>
>> My working powerTable code on 1.99.3 no longer works on 2.0.9.
>>
>> On Monday, October 1, 2012 1:23:54 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> Can you please try the trunk version?
>>>
>>> On Sunday, 30 September 2012 21:32:22 UTC-5, visuallinux wrote:

 Dear Massimo.

 My code is the following:

 @auth.requires_membership('Administrador')
 def clientes():


 class Virtual(object):

 @virtualsettings(label=T('Editar'))
 def edit(self):
 
 link_editar= URL(r =request,f='editablefunction',
 args=[self.clientes.id])
 link_icono_editar= IMG(_src=URL(r=request,c='static',
 f='images/Edit_Icon.png'),
 _alt='Editar'
 )
 return (A(link_icono_editar,_href= link_editar))# + str(
 self.clientes.id))) 

reg=db(db.clientes).select(db.clientes.id
 ,db.clientes.rut,db.clientes.dv,db.clientes.rsocial,
 
 db.clientes.direccion,db.clientes.ciudad,db.clientes.mail,
 
 db.clientes.tipo,db.clientes.fecha,db.clientes.giro,db.tarifa.nombre,
 db.estados.nombre,db.clientes.tarifica,
 join=(db.tarifa.on(db.clientes.id_tarifa==db.tarifa.id),
 db.estados.on(db.clientes.estado==db.estados.id),
 db.tipos.on(db.clientes.tipo==db.tipos.id),
 db.tarificacion.on(db.clientes.tarifica==
 db.tarificacion.id)),

 orderby=db.clientes.rsocial)

 powerTable = plugins.powerTable
 powerTable.datasource = reg
 .
 .
 table=powerTable.create()
 return dict(table=table)


 I do not understand what is wrong.

 --- On *Sun, 9/30/12, Massimo Di Pierro * wrote:


 From: Massimo Di Pierro 
 Subject: [web2py] Re: powerTable AttributeError: 'DAL' object has no 
 attribute 'virtual'
 To: web...@googlegroups.com
 Date: Sunday, September 30, 2012, 11:00 PM

 I think it should be Virtual, not virtual.

 On Sunday, 30 September 2012 20:11:34 UTC-5, visuallinux wrote:

 Dear All. 

 I am trying to use PowerTable, but i am receiving the follow error: 

 Traceback (most recent call last): 
   File "/home/fvillarroel/www/web2py/ gluon/restricted.py", line 209, 
 in restricted 
 exec ccode in environment 
   File "/home/fvillarroel/www/web2py/ applications/administrador/ 
 controllers/clientes.py", line 107, in  
   File "/home/fvillarroel/www/web2py/ gluon/globals.py", line 185, in 
  
 self._caller = lambda f: f() 
   File "/home/fvillarroel/www/web2py/ gluon/tools.py", line 2783, in f 
 return action(*a, **b) 
   File "/home/fvillarroel/www/web2py/ applications/administrador/ 
 controllers/clientes.py", line 63, in clientes 
 table=powerTable.create() 
   File "/home/fvillarroel/www/web2py/ applications/administrador/ 
 models/plugin_powertable.py", line 704, in plugin_powertable 
 PowerTable(), 
   File "/home/fvillarroel/www/web2py/ applications/administrador/ 
 models/plugin_powertable.py", line 178, in __init__ 
 headers[c] = sqlrows.db[t][f].label 
   File "/home/fvillarroel/www/web2py/ gluon/dal.py", line 7136, in 
 __getitem__ 
 return self.__getattr__(str(key)) 
   File "/home/fvillarroel/www/web2py/ gluon/dal.py", line 7143, in 
 __getattr__ 
 return ogetattr(self, key) 
 AttributeError: 'DAL' object has no attribute 'virtual' 


 Any idea. 


  -- 
  
  
  



-- 





[web2py] Re: Need help... testing new DAL

2012-10-02 Thread Adi
light tested against 3 apps and all seems to work fine so far. 

Adnan

On Monday, October 1, 2012 10:32:16 PM UTC-4, Massimo Di Pierro wrote:
>
> There is a big change in DAL.
>
> a = DAL(uri)
> b = DAL(uri)
>
> now "a is b" because DAL is a singleton (almost). It is a thread local 
> singleton as long a uri is specified.
> What does this mean in practice?
>
> It means that unless you have lazy virtual fields, Row and Rows objects 
> can be serialized (pickled), properly cached, and stored in session.
> For example:
>
> session.rows = session.rows or db(db.mytable).select()
>
> and you can still do:
>
> session.rows.first().update_record()
>
> has many practical implications in the way you program and there is even 
> more we could do. In the future we may be able to serialize every DAL 
> expression.
>
> This is a big change in the source and the internal logic is complex. 
> It may have some unforeseen side effects.
> PLEASE TEST THAT TRUNK DOES NOT BREAK YOUR CODE before this makes it into 
> stable.
>
> massimo
>
>
>
>
>
>

-- 





Re: [web2py] Re: framework benchmarks - web2py surprisingly slow?

2012-10-02 Thread Ricardo Pedroso
On Mon, Oct 1, 2012 at 11:28 PM, Massimo Di Pierro
 wrote:
> Does it support ssl?

Yes.

> We need to benchmark it for non-linux environments. Also I am not sure about
> the PycURL dependence for python2.5.

PycURL is only need for the http client part, to act as a server,
there is no need.


> Can you send us instructions to build a single-file tornado server?

As I said, once I did a single-file build of tornado 1.2.1.
It wasn't an automatic build with some script magic, but instead,
was made by hand and was surprisingly easy to join the essential parts.


Today I look at tornado and they are in version 2.4. So I spend some
time rebuild
the single-file tornado. It was easier and smaller with version 1.2,
but it is still easy.

I put it on github (https://github.com/rpedroso/motor) with some instrutions.


It was tested only in Linux, so may work (I hope) or not for others systems.

I put the results of two ab benchmarks in the README
(rocket vs monolithic tornado) of web2py trunk


Ricardo


> On Monday, 1 October 2012 16:27:11 UTC-5, Ricardo Pedroso wrote:
>>
>> On Sun, Sep 30, 2012 at 6:43 PM, Massimo Di Pierro
>>  wrote:
>> > We can only package pure python web servers. Tornado does not meet this
>> > requirement.
>>
>>
>> Tornado is pure Python and very fast - and even much faster with PyPy.
>>
>> It only has an optional C module for those who want to use epoll on
>> Linux/Python2.5,
>> if this module is not available it will use select, this is the logic
>> in tornado at the end of ioloop.py:
>>
>> # Choose a poll implementation. Use epoll if it is available, fall back to
>> # select() for non-Linux platforms
>> if hasattr(select, "epoll"):
>> # Python 2.6+ on Linux
>> _poll = select.epoll
>> elif hasattr(select, "kqueue"):
>> # Python 2.6+ on BSD or Mac
>> _poll = _KQueue
>> else:
>> try:
>> # Linux systems with our C module installed
>> import epoll
>> _poll = _EPoll
>> except Exception:
>> # All other systems
>> import sys
>> if "linux" in sys.platform:
>> logging.warning("epoll module not found; using select()")
>> _poll = _Select
>>
>> It can be put in a single py module. I once did it with tornado
>> version 1.2.1 and if I recall the size
>> was around 40/50k of code
>>
>> The big difference with rocket is that it's not a threaded server. The
>> recommended way is running
>> one instance per CPU - this can be handled automatically by tornado.
>>
>> Ricardo
>
> --
>
>
>

-- 





[web2py] Re: exceptions.EOFError

2012-10-02 Thread Derek
Scratch that, 1.99.7 didnt have my fix. This may be a different issue, or 
it could be regression of an old issue.

My problem was that when I went to view tickets, if I clicked the "db" 
button, it gave this error, because there was no tickets database.

On Tuesday, October 2, 2012 3:50:47 PM UTC-7, Derek wrote:
>
> Yea, 2.0.9 didn't have the fix for this. That was an issue that I 
> reported. It just means you are trying to access the database view of a 
> ticket and there are no tickets.
>
> On Tuesday, October 2, 2012 7:54:37 AM UTC-7, Massimo Di Pierro wrote:
>>
>> If you use trunk, please use the latest. I have no clue what was in trunk 
>> on 2012-9-25. I was running lots of tests. It says "stable" but that was 
>> trunk, not stable. 
>>
>> Massimo
>>
>> On Tuesday, 2 October 2012 08:11:52 UTC-5, mweissen wrote:
>>>
>>> I have got the following message - what does it mean?
>>>
>>>  Version  web2py™ (2, 0, 9, 
>>> datetime.datetime(2012, 9, 25, 16, 18, 48), 'stable')  Python Python 
>>> 2.7.3: /usr/bin/python  Traceback 
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>>
>>> Traceback (most recent call last):
>>>   File "/users/www-data/web2py/gluon/restricted.py", line 209, in restricted
>>>
>>>
>>> exec ccode in environment
>>>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
>>> ,
>>>  line 1703, in 
>>>
>>>
>>>   File "/users/www-data/web2py/gluon/globals.py", line 186, in 
>>>
>>>
>>> self._caller = lambda f: f()
>>>
>>>
>>>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
>>> ,
>>>  line 1529, in ticket
>>>
>>>
>>> e.load(request, app, ticket)
>>>
>>>
>>>   File "/users/www-data/web2py/gluon/restricted.py", line 168, in load
>>>
>>>
>>> d = ticket_storage.load(request, app, ticket_id)
>>>
>>>
>>>   File "/users/www-data/web2py/gluon/restricted.py", line 96, in load
>>>
>>>
>>> return cPickle.load(ef)
>>> EOFError
>>>
>>>   Error snapshot [image: help]
>>>
>>> Regards, Martin
>>>
>>

-- 





[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-02 Thread apps in tables
For me,

The using of datatable will make the menu hovering not working.

removed datatable and the menu is working fine...

Regards.

-- 





[web2py] Re: exceptions.EOFError

2012-10-02 Thread Derek
Yea, 2.0.9 didn't have the fix for this. That was an issue that I reported. 
It just means you are trying to access the database view of a ticket and 
there are no tickets.

On Tuesday, October 2, 2012 7:54:37 AM UTC-7, Massimo Di Pierro wrote:
>
> If you use trunk, please use the latest. I have no clue what was in trunk 
> on 2012-9-25. I was running lots of tests. It says "stable" but that was 
> trunk, not stable. 
>
> Massimo
>
> On Tuesday, 2 October 2012 08:11:52 UTC-5, mweissen wrote:
>>
>> I have got the following message - what does it mean?
>>
>>  Version  web2py™ (2, 0, 9, 
>> datetime.datetime(2012, 9, 25, 16, 18, 48), 'stable')  Python Python 
>> 2.7.3: /usr/bin/python  Traceback 
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>>
>> Traceback (most recent call last):
>>   File "/users/www-data/web2py/gluon/restricted.py", line 209, in restricted
>>
>>
>> exec ccode in environment
>>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
>> ,
>>  line 1703, in 
>>
>>
>>   File "/users/www-data/web2py/gluon/globals.py", line 186, in 
>>
>>
>> self._caller = lambda f: f()
>>
>>
>>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
>> ,
>>  line 1529, in ticket
>>
>>
>> e.load(request, app, ticket)
>>
>>
>>   File "/users/www-data/web2py/gluon/restricted.py", line 168, in load
>>
>>
>> d = ticket_storage.load(request, app, ticket_id)
>>
>>
>>   File "/users/www-data/web2py/gluon/restricted.py", line 96, in load
>>
>>
>> return cPickle.load(ef)
>> EOFError
>>
>>   Error snapshot [image: help]
>>
>> Regards, Martin
>>
>

-- 





Re: [web2py] Reload routes command line?

2012-10-02 Thread Jonathan Lundell
On 2 Oct 2012, at 3:42 PM, Bruno Rocha  wrote:
> You could do that from the command line, too, with a python script.
> 
> I understood that it need to run under the current running environment right? 
> if I have a server running (apache) and I open a web2py console I will have 
> two different environments, how the routes reloaded on the shell will be 
> reflected on the running apache? 
> 
> -- 
>  
>  
>  

Good point.

-- 





Re: [web2py] Reload routes command line?

2012-10-02 Thread Bruno Rocha
>
> You could do that from the command line, too, with a python script.
>

I understood that it need to run under the current running environment
right? if I have a server running (apache) and I open a web2py console I
will have two different environments, how the routes reloaded on the shell
will be reflected on the running apache?

-- 





Re: [web2py] Reload routes command line?

2012-10-02 Thread Jonathan Lundell
On 2 Oct 2012, at 11:53 AM, Bruno Rocha  wrote:
> This is what admin does, but this have to be executed within the environent. 
> You can have a controller to execute this:
> 
> def reload_routes():
> 
> 
> """ Reload routes.py """
> 
> 
> import gluon.rewrite
> 
> 
> gluon.rewrite.load()
> 

You could do that from the command line, too, with a python script.

-- 





Re: [web2py] Re: exceptions.EOFError

2012-10-02 Thread Martin Weissenboeck
ok, thx!

2012/10/2 Massimo Di Pierro 

> If you use trunk, please use the latest. I have no clue what was in trunk
> on 2012-9-25. I was running lots of tests. It says "stable" but that was
> trunk, not stable.
>
> Massimo
>
>
> On Tuesday, 2 October 2012 08:11:52 UTC-5, mweissen wrote:
>>
>> I have got the following message - what does it mean?
>>
>>  Version  web2py™ (2, 0, 9,
>> datetime.datetime(2012, 9, 25, 16, 18, 48), 'stable')  Python Python
>> 2.7.3: /usr/bin/python  Traceback
>>
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>>
>>
>> Traceback (most recent call last):
>>   File "/users/www-data/web2py/gluon/**restricted.py", line 209, in 
>> restricted
>>
>>
>>
>> exec ccode in environment
>>   File 
>> "/users/www-data/web2py/**applications/admin/**controllers/default.py" 
>> ,
>>  line 1703, in 
>>
>>
>>
>>   File "/users/www-data/web2py/gluon/**globals.py", line 186, in 
>>
>>
>>
>> self._caller = lambda f: f()
>>
>>
>>
>>   File 
>> "/users/www-data/web2py/**applications/admin/**controllers/default.py" 
>> ,
>>  line 1529, in ticket
>>
>>
>>
>> e.load(request, app, ticket)
>>
>>
>>
>>   File "/users/www-data/web2py/gluon/**restricted.py", line 168, in load
>>
>>
>>
>> d = ticket_storage.load(request, app, ticket_id)
>>
>>
>>
>>   File "/users/www-data/web2py/gluon/**restricted.py", line 96, in load
>>
>>
>>
>> return cPickle.load(ef)
>> EOFError
>>
>>   Error snapshot [image: help]
>>
>>

-- 





Re: [web2py] New version of bootstrap

2012-10-02 Thread Richard Vézina
Yes I am!

This is nice.

It is just in case there is more menu entry than expect sometime, since I
show differents things depending of the role of the user and I don't always
take a look how the page are rendered for all the user when I make changes.
I would avoid at least they can't works with the system.

So, the solution you suggest seems really appropriate and your help is very
appreciated!

:)

Richard

On Tue, Oct 2, 2012 at 5:21 PM, Paolo Caruccio
wrote:

> Richard, are you the author of this message
> https://groups.google.com/d/msg/web2py-developers/qKO_hLh2W9U/_UcR5GEp1ToJ
> ?
>
> If yes, in welcome app we have adopted the following solution:
>
> body {height:auto;}
> #header (margin-top:60px;}
>
> without any body top padding.
>
> In other words, you could set a top margin on first container in place of
> a top padding on the body.
>
> Only one note: in responsive design at small size viewport you will have
> extra top margin when top navbar becomes static but this can be corrected
> through media queries.
>
>
> Il giorno martedì 2 ottobre 2012 22:49:05 UTC+2, Richard ha scritto:
>>
>> Solved
>>
>> Thanks Paolo, it was driving me nuts.
>>
>> Richard
>>
>> On Tue, Oct 2, 2012 at 4:39 PM, Richard Vézina wrote:
>>
>>> Thanks Paolo,
>>>
>>> It works for welcome.
>>>
>>> Still have difficulties with my app but I made many little changes maybe
>>> I broke something somewhere.
>>>
>>> Richard
>>>
>>>
>>> On Tue, Oct 2, 2012 at 4:27 PM, Paolo Caruccio wrote:
>>>
 Richard,

 the issue has been corrected some time ago. Please check the trunk
 version.

 Anyway, you could replace

 .icon-white{background-image:u**rl("../images/glyphicons-**
 halflings-white.png");} /* right folder for bootstrap white
 images/icons */

 with

 /* right folder for bootstrap white images/icons */
 .icon-white,
 .nav-tabs > .active > a > [class^="icon-"],
 .nav-tabs > .active > a > [class*=" icon-"],
 .nav-pills > .active > a > [class^="icon-"],
 .nav-pills > .active > a > [class*=" icon-"],
 .nav-list > .active > a > [class^="icon-"],
 .nav-list > .active > a > [class*=" icon-"],
 .navbar-inverse .nav > .active > a > [class^="icon-"],
 .navbar-inverse .nav > .active > a > [class*=" icon-"],
 .dropdown-menu > li > a:hover > [class^="icon-"],
 .dropdown-menu > li > a:hover > [class*=" icon-"],
 .dropdown-menu > .active > a > [class^="icon-"],
 .dropdown-menu > .active > a > [class*=" icon-"] {
   background-image:url("../**images/glyphicons-halflings-**white.png");
 }





 Il giorno martedì 2 ottobre 2012 22:09:01 UTC+2, Richard ha scritto:
>
> I found an other little issue using last version of bootstrap with
> web2py 2.0.9
>
> The icons disapears on rollover, only the blue highligth remain and
> the inversed white texte of the a tag, but the  class"icon-something"> don't follow...
>
> Can't find why...
>
> These lines from web2py_bootstrap.css :
>
> [class^="icon-"],[class*=" icon-"]{background-image:url("
> ../images/glyphicons-**halflings**.png")} /* right folder for
> bootstrap black images/icons */
> .icon-white{background-image:**u**rl("../images/glyphicons-**halfl**ings-white.png");}
> /* right folder for bootstrap white images/icons */
>
> Could be in cause.
>
> It likes if the icons never get the icon-white class setup by
> bootstrap.js (I am not sure how bootstrap works exactly), it can find the
> glypicons white file...
>
> Richard
>
> On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  wrote:
>
>> Yeah, seems also that doesn't break anything (except for the navbar
>> default color that now is gray (.navbar-inverse does the job)). Seems 
>> also
>> to not break web2py styles.
>> However, affix has an issue: try resizing the Components page of the
>> documentation a lot on the y side (try something like 900px*500px) 
>> you
>> need to scroll to the end of the page to access the last links. Bummer.
>>
>>
>> On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:
>>>
>>> Bootstrap would now seem to provide sufficient support for web2py
>>> menus:
>>>
>>> - Submenu support on dropdowns.
>>> - Disabled states on navs and dropdowns.
>>>
>>> And the Affix JavaScript plugin is cool.
>>>
>>> On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI
>>> wrote:

 Awesome!

 On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor 
 wrote:

> There's a new version of bootstrap available.
>
> Might be worth upgrading: https://github.com/web2py/**web2
> py/pull/27 
>
> --
>
>
>
>
  --
>>
>>
>>
>

Re: [web2py] New version of bootstrap

2012-10-02 Thread Paolo Caruccio
Richard, are you the author of this message 
https://groups.google.com/d/msg/web2py-developers/qKO_hLh2W9U/_UcR5GEp1ToJ?

If yes, in welcome app we have adopted the following solution:

body {height:auto;}
#header (margin-top:60px;}

without any body top padding.

In other words, you could set a top margin on first container in place of a 
top padding on the body.

Only one note: in responsive design at small size viewport you will have 
extra top margin when top navbar becomes static but this can be corrected 
through media queries.


Il giorno martedì 2 ottobre 2012 22:49:05 UTC+2, Richard ha scritto:
>
> Solved
>
> Thanks Paolo, it was driving me nuts.
>
> Richard
>
> On Tue, Oct 2, 2012 at 4:39 PM, Richard Vézina 
> 
> > wrote:
>
>> Thanks Paolo,
>>
>> It works for welcome.
>>
>> Still have difficulties with my app but I made many little changes maybe 
>> I broke something somewhere.
>>
>> Richard
>>
>>
>> On Tue, Oct 2, 2012 at 4:27 PM, Paolo Caruccio 
>> 
>> > wrote:
>>
>>> Richard,
>>>
>>> the issue has been corrected some time ago. Please check the trunk 
>>> version.
>>>
>>> Anyway, you could replace
>>>
>>> .icon-white{background-image:url(
>>> "../images/glyphicons-halflings-white.png");} /* right folder for 
>>> bootstrap white images/icons */
>>>
>>> with
>>>
>>> /* right folder for bootstrap white images/icons */
>>> .icon-white,
>>> .nav-tabs > .active > a > [class^="icon-"],
>>> .nav-tabs > .active > a > [class*=" icon-"],
>>> .nav-pills > .active > a > [class^="icon-"],
>>> .nav-pills > .active > a > [class*=" icon-"],
>>> .nav-list > .active > a > [class^="icon-"],
>>> .nav-list > .active > a > [class*=" icon-"],
>>> .navbar-inverse .nav > .active > a > [class^="icon-"],
>>> .navbar-inverse .nav > .active > a > [class*=" icon-"],
>>> .dropdown-menu > li > a:hover > [class^="icon-"],
>>> .dropdown-menu > li > a:hover > [class*=" icon-"],
>>> .dropdown-menu > .active > a > [class^="icon-"],
>>> .dropdown-menu > .active > a > [class*=" icon-"] {
>>>   background-image:url("../images/glyphicons-halflings-white.png");
>>> }
>>>
>>>
>>>
>>>
>>>
>>> Il giorno martedì 2 ottobre 2012 22:09:01 UTC+2, Richard ha scritto:

 I found an other little issue using last version of bootstrap with 
 web2py 2.0.9

 The icons disapears on rollover, only the blue highligth remain and the 
 inversed white texte of the a tag, but the  
 don't follow... 

 Can't find why...

 These lines from web2py_bootstrap.css :

 [class^="icon-"],[class*=" icon-"]{background-image:url("**
 ../images/glyphicons-**halflings.png")} /* right folder for bootstrap 
 black images/icons */
 .icon-white{background-image:**url("../images/glyphicons-**halflings-white.png");}
  
 /* right folder for bootstrap white images/icons */

 Could be in cause.

 It likes if the icons never get the icon-white class setup by 
 bootstrap.js (I am not sure how bootstrap works exactly), it can find the 
 glypicons white file...

 Richard

 On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  wrote:

> Yeah, seems also that doesn't break anything (except for the navbar 
> default color that now is gray (.navbar-inverse does the job)). Seems 
> also 
> to not break web2py styles.
> However, affix has an issue: try resizing the Components page of the 
> documentation a lot on the y side (try something like 900px*500px) 
> you 
> need to scroll to the end of the page to access the last links. Bummer.
>
>
> On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:
>>
>> Bootstrap would now seem to provide sufficient support for web2py 
>> menus:
>>
>> - Submenu support on dropdowns.
>> - Disabled states on navs and dropdowns.
>>
>> And the Affix JavaScript plugin is cool.
>>
>> On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI 
>> wrote:
>>>
>>> Awesome!
>>>
>>> On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor 
>>> wrote:
>>>
 There's a new version of bootstrap available.

 Might be worth upgrading: https://github.com/web2py/**web2**
 py/pull/27 

 --




>>>  -- 
>  
>  
>  
>

  -- 
>>>  
>>>  
>>>  
>>>
>>
>>
>

-- 





[web2py] Re: {less} ify the welcome styles?

2012-10-02 Thread Dave
Fair enough.

Adam, I am using Kickstrap already :)

On Monday, October 1, 2012 10:41:31 PM UTC-4, Massimo Di Pierro wrote:
>
> The problem is that web2py scaffolding app is supposed to be simple. It is 
> already too complex for my taste. I like less but it adds one more layer of 
> abstraction for new users (new to python/html/css already).
>
> On Sunday, 30 September 2012 13:42:42 UTC-5, Dave wrote:
>>
>> Massimo et al,
>>
>> I wonder if it would be a good idea to look at building .less styles for 
>> the welcome scaffolding.  That could allow for easier customization of the 
>> app.  While I love Twitter bootstrap, it's quite a pain in the rear to edit 
>> the minified CSS.  Also, its beta, but I am doing some tinkering with 
>> Kickstrap.  It has some promise and neat features on top of bootstrap, 
>> while maintaining full support for all bootstrap features.
>>
>> Thoughts?
>>
>

-- 





[web2py] Re: checkboxes widget with list:string - request.vars type

2012-10-02 Thread Massimo Di Pierro
Because in request.vars just contains the POST variables and the HTTP 
protocol cannot distinguish a single checkbox from a normal input. If you 
look into form.vars.checkbox you find it is always a list. The form knows 
this is a checkbox, the request objects does not.

On Tuesday, 2 October 2012 14:30:14 UTC-5, andrej burja wrote:
>
> hi
>
> i have SQLFORM with checkboxes (widget).
> if i choose one checkbox, type(request.varst.checkbox) is 'string'
> and if i choose more than one checkbox, tpye(request.vars.checkbox) is 
> 'list'
> why choosing one checkbox does not return 'list'?
>
>
> form = SQLFORM.factory(Field('checkbox','list:string',label=T('Equipment'
> ),requires=IS_EMPTY_OR(IS_IN_SET(some_set,multiple=True)),
> widget=SQLFORM.widgets.checkboxes.
> widget)
>
> andrej
>
>

-- 





Re: [web2py] New version of bootstrap

2012-10-02 Thread Richard Vézina
Solved

Thanks Paolo, it was driving me nuts.

Richard

On Tue, Oct 2, 2012 at 4:39 PM, Richard Vézina
wrote:

> Thanks Paolo,
>
> It works for welcome.
>
> Still have difficulties with my app but I made many little changes maybe I
> broke something somewhere.
>
> Richard
>
>
> On Tue, Oct 2, 2012 at 4:27 PM, Paolo Caruccio  > wrote:
>
>> Richard,
>>
>> the issue has been corrected some time ago. Please check the trunk
>> version.
>>
>> Anyway, you could replace
>>
>> .icon-white{background-image:url(
>> "../images/glyphicons-halflings-white.png");} /* right folder for
>> bootstrap white images/icons */
>>
>> with
>>
>> /* right folder for bootstrap white images/icons */
>> .icon-white,
>> .nav-tabs > .active > a > [class^="icon-"],
>> .nav-tabs > .active > a > [class*=" icon-"],
>> .nav-pills > .active > a > [class^="icon-"],
>> .nav-pills > .active > a > [class*=" icon-"],
>> .nav-list > .active > a > [class^="icon-"],
>> .nav-list > .active > a > [class*=" icon-"],
>> .navbar-inverse .nav > .active > a > [class^="icon-"],
>> .navbar-inverse .nav > .active > a > [class*=" icon-"],
>> .dropdown-menu > li > a:hover > [class^="icon-"],
>> .dropdown-menu > li > a:hover > [class*=" icon-"],
>> .dropdown-menu > .active > a > [class^="icon-"],
>> .dropdown-menu > .active > a > [class*=" icon-"] {
>>   background-image:url("../images/glyphicons-halflings-white.png");
>> }
>>
>>
>>
>>
>>
>> Il giorno martedì 2 ottobre 2012 22:09:01 UTC+2, Richard ha scritto:
>>>
>>> I found an other little issue using last version of bootstrap with
>>> web2py 2.0.9
>>>
>>> The icons disapears on rollover, only the blue highligth remain and the
>>> inversed white texte of the a tag, but the 
>>> don't follow...
>>>
>>> Can't find why...
>>>
>>> These lines from web2py_bootstrap.css :
>>>
>>> [class^="icon-"],[class*=" icon-"]{background-image:url("**
>>> ../images/glyphicons-**halflings.png")} /* right folder for bootstrap
>>> black images/icons */
>>> .icon-white{background-image:**url("../images/glyphicons-**halflings-white.png");}
>>> /* right folder for bootstrap white images/icons */
>>>
>>> Could be in cause.
>>>
>>> It likes if the icons never get the icon-white class setup by
>>> bootstrap.js (I am not sure how bootstrap works exactly), it can find the
>>> glypicons white file...
>>>
>>> Richard
>>>
>>> On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  wrote:
>>>
 Yeah, seems also that doesn't break anything (except for the navbar
 default color that now is gray (.navbar-inverse does the job)). Seems also
 to not break web2py styles.
 However, affix has an issue: try resizing the Components page of the
 documentation a lot on the y side (try something like 900px*500px) you
 need to scroll to the end of the page to access the last links. Bummer.


 On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:
>
> Bootstrap would now seem to provide sufficient support for web2py
> menus:
>
> - Submenu support on dropdowns.
> - Disabled states on navs and dropdowns.
>
> And the Affix JavaScript plugin is cool.
>
> On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI
> wrote:
>>
>> Awesome!
>>
>> On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor wrote:
>>
>>> There's a new version of bootstrap available.
>>>
>>> Might be worth upgrading: https://github.com/web2py/**web2**
>>> py/pull/27 
>>>
>>> --
>>>
>>>
>>>
>>>
>>  --




>>>
>>>  --
>>
>>
>>
>>
>
>

-- 





Re: [web2py] New version of bootstrap

2012-10-02 Thread Richard Vézina
Thanks Paolo,

It works for welcome.

Still have difficulties with my app but I made many little changes maybe I
broke something somewhere.

Richard

On Tue, Oct 2, 2012 at 4:27 PM, Paolo Caruccio
wrote:

> Richard,
>
> the issue has been corrected some time ago. Please check the trunk version.
>
> Anyway, you could replace
>
> .icon-white{background-image:url(
> "../images/glyphicons-halflings-white.png");} /* right folder for
> bootstrap white images/icons */
>
> with
>
> /* right folder for bootstrap white images/icons */
> .icon-white,
> .nav-tabs > .active > a > [class^="icon-"],
> .nav-tabs > .active > a > [class*=" icon-"],
> .nav-pills > .active > a > [class^="icon-"],
> .nav-pills > .active > a > [class*=" icon-"],
> .nav-list > .active > a > [class^="icon-"],
> .nav-list > .active > a > [class*=" icon-"],
> .navbar-inverse .nav > .active > a > [class^="icon-"],
> .navbar-inverse .nav > .active > a > [class*=" icon-"],
> .dropdown-menu > li > a:hover > [class^="icon-"],
> .dropdown-menu > li > a:hover > [class*=" icon-"],
> .dropdown-menu > .active > a > [class^="icon-"],
> .dropdown-menu > .active > a > [class*=" icon-"] {
>   background-image:url("../images/glyphicons-halflings-white.png");
> }
>
>
>
>
>
> Il giorno martedì 2 ottobre 2012 22:09:01 UTC+2, Richard ha scritto:
>>
>> I found an other little issue using last version of bootstrap with web2py
>> 2.0.9
>>
>> The icons disapears on rollover, only the blue highligth remain and the
>> inversed white texte of the a tag, but the 
>> don't follow...
>>
>> Can't find why...
>>
>> These lines from web2py_bootstrap.css :
>>
>> [class^="icon-"],[class*=" icon-"]{background-image:url("**
>> ../images/glyphicons-**halflings.png")} /* right folder for bootstrap
>> black images/icons */
>> .icon-white{background-image:**url("../images/glyphicons-**halflings-white.png");}
>> /* right folder for bootstrap white images/icons */
>>
>> Could be in cause.
>>
>> It likes if the icons never get the icon-white class setup by
>> bootstrap.js (I am not sure how bootstrap works exactly), it can find the
>> glypicons white file...
>>
>> Richard
>>
>> On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  wrote:
>>
>>> Yeah, seems also that doesn't break anything (except for the navbar
>>> default color that now is gray (.navbar-inverse does the job)). Seems also
>>> to not break web2py styles.
>>> However, affix has an issue: try resizing the Components page of the
>>> documentation a lot on the y side (try something like 900px*500px) you
>>> need to scroll to the end of the page to access the last links. Bummer.
>>>
>>>
>>> On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:

 Bootstrap would now seem to provide sufficient support for web2py menus:

 - Submenu support on dropdowns.
 - Disabled states on navs and dropdowns.

 And the Affix JavaScript plugin is cool.

 On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI
 wrote:
>
> Awesome!
>
> On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor wrote:
>
>> There's a new version of bootstrap available.
>>
>> Might be worth upgrading: https://github.com/web2py/**web2**
>> py/pull/27 
>>
>> --
>>
>>
>>
>>
>  --
>>>
>>>
>>>
>>>
>>
>>  --
>
>
>
>

-- 





Re: [web2py] New version of bootstrap

2012-10-02 Thread Paolo Caruccio
Richard,

the issue has been corrected some time ago. Please check the trunk version.

Anyway, you could replace

.icon-white{background-image:url("../images/glyphicons-halflings-white.png"
);} /* right folder for bootstrap white images/icons */

with

/* right folder for bootstrap white images/icons */
.icon-white,
.nav-tabs > .active > a > [class^="icon-"],
.nav-tabs > .active > a > [class*=" icon-"],
.nav-pills > .active > a > [class^="icon-"],
.nav-pills > .active > a > [class*=" icon-"],
.nav-list > .active > a > [class^="icon-"],
.nav-list > .active > a > [class*=" icon-"],
.navbar-inverse .nav > .active > a > [class^="icon-"],
.navbar-inverse .nav > .active > a > [class*=" icon-"],
.dropdown-menu > li > a:hover > [class^="icon-"],
.dropdown-menu > li > a:hover > [class*=" icon-"],
.dropdown-menu > .active > a > [class^="icon-"],
.dropdown-menu > .active > a > [class*=" icon-"] {
  background-image:url("../images/glyphicons-halflings-white.png");
}





Il giorno martedì 2 ottobre 2012 22:09:01 UTC+2, Richard ha scritto:
>
> I found an other little issue using last version of bootstrap with web2py 
> 2.0.9
>
> The icons disapears on rollover, only the blue highligth remain and the 
> inversed white texte of the a tag, but the  
> don't follow... 
>
> Can't find why...
>
> These lines from web2py_bootstrap.css :
>
> [class^="icon-"],[class*=" 
> icon-"]{background-image:url("../images/glyphicons-halflings.png")} /* 
> right folder for bootstrap black images/icons */
> .icon-white{background-image:url("../images/glyphicons-halflings-white.png");}
>  
> /* right folder for bootstrap white images/icons */
>
> Could be in cause.
>
> It likes if the icons never get the icon-white class setup by bootstrap.js 
> (I am not sure how bootstrap works exactly), it can find the glypicons 
> white file...
>
> Richard
>
> On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  >wrote:
>
>> Yeah, seems also that doesn't break anything (except for the navbar 
>> default color that now is gray (.navbar-inverse does the job)). Seems also 
>> to not break web2py styles.
>> However, affix has an issue: try resizing the Components page of the 
>> documentation a lot on the y side (try something like 900px*500px) you 
>> need to scroll to the end of the page to access the last links. Bummer.
>>
>>
>> On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:
>>>
>>> Bootstrap would now seem to provide sufficient support for web2py menus:
>>>
>>> - Submenu support on dropdowns.
>>> - Disabled states on navs and dropdowns.
>>>
>>> And the Affix JavaScript plugin is cool.
>>>
>>> On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI wrote:

 Awesome!

 On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor wrote:

> There's a new version of bootstrap available.
>
> Might be worth upgrading: 
> https://github.com/web2py/**web2py/pull/27
>
> --
>
>
>
>
  -- 
>>  
>>  
>>  
>>
>
>

-- 





Re: [web2py] New version of bootstrap

2012-10-02 Thread Richard Vézina
I found an other little issue using last version of bootstrap with web2py
2.0.9

The icons disapears on rollover, only the blue highligth remain and the
inversed white texte of the a tag, but the 
don't follow...

Can't find why...

These lines from web2py_bootstrap.css :

[class^="icon-"],[class*="
icon-"]{background-image:url("../images/glyphicons-halflings.png")} /*
right folder for bootstrap black images/icons */
.icon-white{background-image:url("../images/glyphicons-halflings-white.png");}
/* right folder for bootstrap white images/icons */

Could be in cause.

It likes if the icons never get the icon-white class setup by bootstrap.js
(I am not sure how bootstrap works exactly), it can find the glypicons
white file...

Richard

On Wed, Aug 22, 2012 at 5:34 PM, Niphlod  wrote:

> Yeah, seems also that doesn't break anything (except for the navbar
> default color that now is gray (.navbar-inverse does the job)). Seems also
> to not break web2py styles.
> However, affix has an issue: try resizing the Components page of the
> documentation a lot on the y side (try something like 900px*500px) you
> need to scroll to the end of the page to access the last links. Bummer.
>
>
> On Wednesday, August 22, 2012 10:37:42 PM UTC+2, Limedrop wrote:
>>
>> Bootstrap would now seem to provide sufficient support for web2py menus:
>>
>> - Submenu support on dropdowns.
>> - Disabled states on navs and dropdowns.
>>
>> And the Affix JavaScript plugin is cool.
>>
>> On Wednesday, August 22, 2012 11:27:03 PM UTC+12, Khalil KHAMLICHI wrote:
>>>
>>> Awesome!
>>>
>>> On Wed, Aug 22, 2012 at 11:10 AM, Alec Taylor wrote:
>>>
 There's a new version of bootstrap available.

 Might be worth upgrading: 
 https://github.com/web2py/**web2py/pull/27

 --




>>>  --
>
>
>
>

-- 





[web2py] checkboxes widget with list:string - request.vars type

2012-10-02 Thread andrej burja
hi

i have SQLFORM with checkboxes (widget).
if i choose one checkbox, type(request.varst.checkbox) is 'string'
and if i choose more than one checkbox, tpye(request.vars.checkbox) is 
'list'
why choosing one checkbox does not return 'list'?


form = SQLFORM.factory(Field('checkbox','list:string',label=T('Equipment'),
requires=IS_EMPTY_OR(IS_IN_SET(some_set,multiple=True)),
widget=SQLFORM.widgets.checkboxes.widget
)

andrej

-- 





[web2py] Re: RBAC example?

2012-10-02 Thread Cliff Kachinske
After further thought, I've flipped on this.  Just create a separate table 
for casual groups and link it to auth_user in a many-to-many relation 
table.  Call the M2M table user_groups.

Then create the following auth_group records:
- user_groups.create
- user_groups.read
- user_groups.select

Then create the following record in the auth_permission table:
group: user_groups.create; name: create; table: user_groups

Do similar for the other two groups.

When a user logs in to the site, check for records in the auth_membership 
table linking the user to the three groups above.  If they do not exist, 
create them.  That will give your casual users the ability to search for 
groups, read group descriptions and create new groups.

If a user registers via the web interface, the user gets a personal group 
named user_x, where x is the id of the auth_user record.  We will use that 
group to control the user's ability to update and delete groups created by 
him.

When the user creates a group, after the controller inserts the group 
record, verify that there are records in auth_permission granting his 
personal group update and delete permissions on the casual groups table. 
 If the records don't exist, create them.  Be careful to include the id of 
the group record just created (form.vars.id) in the records field of the 
auth_permission record.  If that's missing, the user will have table-wide 
update and delete permissions.

That's how I would do it.



On Sunday, September 30, 2012 10:44:05 PM UTC-4, Alec Taylor wrote:
>
> I have built up a social-network wherein users can great groups, users 
> can join groups and members of groups can RSVP to group events. 
>
> How would you recommend I use web2py's in-built RBAC system to enforce 
> these rules? — Or should I not use it? 
>
> http://bitbucket.org/SamuelMarks/giantpicnic 
>
> Thanks for all suggestions, 
>
> Alec Taylor 
>

-- 





Re: [web2py] Reload routes command line?

2012-10-02 Thread Bruno Rocha
This is what admin does, but this have to be executed within the
environent. You can have a controller to execute this:

def reload_routes():
""" Reload routes.py """
import gluon.rewrite
gluon.rewrite.load()
redirect(URL('your_home_url'))

-- 





Re: [web2py] the ability to pass li class form response.menu could be useful with bootstrap

2012-10-02 Thread Richard Vézina
Maybe yes!

I workaround it by adding : 


  **
  {{is_mobile=request.user_agent().is_mobile}}
  {{if response.menu:}}
  {{=MENU(response.menu, _class='mobile-menu nav' if is_mobile else
'nav',mobile=is_mobile,li_class='dropdown',ul_class='dropdown-menu')}}
  {{pass}}

Richard

On Tue, Oct 2, 2012 at 2:40 PM, Niphlod  wrote:

> at that point isn't it better to wrap up your own menu serialization?
>
> On Tuesday, October 2, 2012 6:34:32 PM UTC+2, Richard wrote:
>>
>> Hello,
>>
>> Here html example of menu with bootstrap :
>>
>> 
>> 
>>   **
>>   **
>> Accueil**
>>
>>   
>>
>> I found it very difficult to generate menu with the li in bold in the
>> example above with MENU and response.menu, since li_class doesn't allow
>> enough flexibility.
>>
>> I don't think we can pass _class attribute in reponse.menu tuple, but it
>> could help a lot in order to allow greater flexibility in the usage and
>> integration with bootstrap.
>>
>> Richard
>>
>  --
>
>
>
>

-- 





Re: [web2py] the ability to pass li class form response.menu could be useful with bootstrap

2012-10-02 Thread Niphlod
at that point isn't it better to wrap up your own menu serialization? 

On Tuesday, October 2, 2012 6:34:32 PM UTC+2, Richard wrote:
>
> Hello,
>
> Here html example of menu with bootstrap :
>
> 
> 
>   **
>   ** 
> Accueil**
>   
>   
>
> I found it very difficult to generate menu with the li in bold in the 
> example above with MENU and response.menu, since li_class doesn't allow 
> enough flexibility.
>
> I don't think we can pass _class attribute in reponse.menu tuple, but it 
> could help a lot in order to allow greater flexibility in the usage and 
> integration with bootstrap.
>
> Richard
>

-- 





[web2py] Re: Reload routes command line?

2012-10-02 Thread Niphlod
You have a running process and you want to have a commandline to 
communicate with it and reload routes ? There is no such thing baked on 
web2py...
Use the admin app or restart the server: if you are running behind nginx, 
apache & co your users will never notice the restart.

On Tuesday, October 2, 2012 6:56:33 PM UTC+2, lyn2py wrote:
>
> Hi, is there a way to reload routes on command line?
>
> For production use. Thanks guys!
>

-- 





[web2py] Re: How do I incorporate git into my web2py workflow?

2012-10-02 Thread Shivakumar GN
On Saturday, 8 September 2012 04:16:13 UTC+5:30, Massimo Di Pierro wrote:

> One of the new features is that in admin you can use a git url to install 
> a web2py directly from github. You can also push 
> an app to github. All of this requires python-git.
>


Isn't that supposed to be gitpython?

-- 





[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-02 Thread Paolo Caruccio
Thank you for your feedback, but I still can't repeat the problem you are 
having. I will do more tests.
With regard to PortableApps, I was just sharing my happy experience: I make 
continuous changes to the settings of my browser, so with repeated installs 
and uninstalls. Using, instead, a portable version of the browser I just 
delete the old folder, and unzip the downloaded file again (such versions 
don't install on the computer and therefore not affect any previous 
installations of the program). I use that downloaded from PortableApps but 
there is also portablefreeware.com
If you are interested, here you will find the definition of portable 
application  http://en.wikipedia.org/wiki/Portable_application
I repeat, I'm just reporting a method by which I am fine, I'm not making 
advertising.


Il giorno martedì 2 ottobre 2012 16:50:07 UTC+2, JoeCodeswell ha scritto:
>
> Dear Paolo,
>
> I cleaned both my Opera and Firefox browsers and STILL got the same 
> result, i.e., the sub-menus show up from the test4joe home page, but NOT 
> when either of the Top Level menu items are hovered over from either of the 
> forms pages. I have included screen shots of how i cleaned the browsers.
>
> I am not sure what you want me to do at portableapps.com. I don't see an 
> Opera browser there. Do you want me to download Firefox and wipe out my 
> present installation, replacing it with the portableapps.com version? I 
> don't know anything about portableapps.com. Do I need to download some of 
> their framework as well? How good a reputation do they have?
>
> Thanks again, Paolo.
>
> Love and peace,
>
> Joe
>
> On Friday, September 28, 2012 3:35:27 PM UTC-7, Paolo Caruccio wrote:
>>
>> Joe,
>>
>> thank you very much for the precious informations.
>>
>> The behavior in Ubuntu that you described at 2.2 point of the list is 
>> normal (collapsed menu).
>>
>> With regard to Windows I can't reproduce the issue on my XP3 system. 
>> Would you please use a cleaned browser (I usually use a portable version 
>> freely downloaded from portableapps.com) with its default settings?
>>
>> I'm looking forward to your reply.
>>
>>
>> Il giorno venerdì 28 settembre 2012 22:28:34 UTC+2, JoeCodeswell ha 
>> scritto:
>>>
>>> Dear Paolo,
>>>
>>> Here are the results from my runs on Ubuntu 12.04 LTS and Windows XP SP3 
>>> machines.
>>>
>>> Ubuntu
>>> 1. ran in trunk version home/web2py-web2py-722b16e
>>> 2. Results
>>> 1. For Full Screen: IMPROVEMENT for menu behavior
>>> menus from index are same as from cu00 or app00 
>>> - menu behavior is better
>>> - menus don't seem to "freeze"
>>> [SEE test4joe-ubu-index-fullScr.jpg]
>>> 2. For Non-fullscreen:
>>> Top Level Menus DO NOT show up [SEE 
>>> test4joe-ubu-index-NOTfull.jpg]
>>> except when 3 white lines are clicked on
>>> [SEE test4joe-ubu-index-NOTfull-click3.jpg]
>>>
>>> Windows
>>> 1. ran in trunk version C:\web2py-web2py-722b16e\web2py-web2py-722b16e
>>> 2. Results:
>>> IMPROVEMENT for menus from index page
>>> NO sub-menus from either update pages
>>> 
>>> 1. from http://127.0.0.1:8000/test4joe/default/index 
>>> -seems like everything WORKS
>>> see test4joe-win-index-OK.jpg
>>> 2. from 
>>> http://127.0.0.1:8000/test4joe/default/update_t_appointment00
>>> -sub-menus DO NOT show up when either Top Level menu item is 
>>> hovered over
>>> see test4joe-win-app00-NG.jpg [unshown cursor is hovering 
>>> over lit up ContactUs Top Level menu item]
>>> the Appointment Top Level menu item does not show 
>>> sub-menus when hovered over 
>>> from this page either
>>> 3. from http://127.0.0.1:8000/test4joe/default/update_t_contactus00
>>> -sub-menus DO NOT show up when either Top Level menu item is 
>>> hovered over
>>> see test4joe-win-cu00-NG.jpg [unshown cursor is hovering 
>>> over lit up Appointment Top Level menu item]
>>> the ContactUs Top Level menu item does not show 
>>> sub-menus when hovered over 
>>> from this page either
>>>
>>>
>>> It seems you are on the right track, Paolo. Thanks for all the help.
>>>
>>> Love and peace,
>>>
>>> Joe
>>>
>>> On Friday, September 28, 2012 8:03:18 AM UTC-7, JoeCodeswell wrote:

 Dear Paolo,

 I will try this on *both* my *Windows* machine *AND* my *Ubuntu*machine. 

 Also, please see my previous post, of about 5 minutes ago, in response 
 to you, regarding the *different* types of *failure modes* for my *Windows 
 and Ubuntu* machines. [The "*three white lines*" *never* show up *on*my 
 *Windows* machine, *only* *on* my *Ubuntu* machine]

 Thanks again, Paolo, for all the help.

 Love and peace,

 Joe

 On Thursday, September 27, 2012 4:27:24 PM UTC-7, Paolo Caruccio wrote:
>
> Joe a last try.
> I confused web2py versions on my pc

[web2py] Problem rewriting URL's non-www to www while using mod_wsgi

2012-10-02 Thread Chris
I have an Apache-WSGI-web2py configuration that is working well.

Now I would like to add the behavior that requests on the bare domain 
(something.com/what/ever) is rewritten to use www 
(www.something.com/what/ever).  In a generic Apache setup, this is easy 
using a rewrite condition + rewrite rule.

When I try this with mod_wsgi, it appears the request is first mapped 
to /path/to/web2py/wsgihandler.py/what/ever before the rewrite rule is 
applied.  mod_rewrite operates on this, and outputs 
http://www.something.com/wsgihandler.py/what/ever (error).  This is visible 
in the mod_rewrite log.

Does anyone have a way to rewrite non-www to www URLs while using mod_wsgi?

Here is the relevant excerpt from my Apache default.conf


  ServerName www.something.com

  ##
  ## rewrite bare domain URLs to canonical/www format
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^something\.com$ [NC]
  RewriteRule ^(.*)$ http://www.something.com/$1 [L,R=301]

  WSGIDaemonProcess web2py processes=5 threads=1 user=apache group=apache 
display-name=wsgi_web2py
  WSGIProcessGroup web2py
  WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py


Thanks all

-- 





[web2py] Reload routes command line?

2012-10-02 Thread lyn2py
Hi, is there a way to reload routes on command line?

For production use. Thanks guys!

-- 





[web2py] Re: web2py 2.0.2 is out

2012-10-02 Thread Massimo Di Pierro
I know what the problem is. Please open a ticket about this so I do not 
forget and I may fix it tonight.

This is a change in grid behavior and we do not promise backward 
compatibility in grid because it is "experimental".

Basically the we speeded up the grid but not generating the full Row(s) 
objects thus your row.routedetails is missing.

In any case it is debatable whether the changes that lead to this are worth 
it, considering the problem you mention. I will probably revert the old 
behavior.

massimo


On Tuesday, 2 October 2012 11:04:30 UTC-5, Nate Atkinson wrote:
>
> I seem to have run into a backwards compatibility issue.
>
> This weekend, I did some system upgrades. I moved my web2py (1.99.7) + 
> MySQL application off a single server running Ubuntu to two VM's running 
> Debian stable (one VM for web2py + apache, one for MySQL). Web2py was 
> deployed using the script in the deployment recipes book section (which 
> downloaded whatever version was current as of Oct 1). MySQL data was moved 
> using mysqldump.
>
> It seems that one-to-many relations are broken in the DAL.
>
> Example code snippets:
>
> From the model:
>
> 
> gaia.define_table('routes',
> Field("Name", required=True),
> Field("Active", "boolean", required=True, default=True),
> format='%(Name)s')
>
> gaia.define_table('routedetails',
> Field('route', gaia.routes),
> Field('site', gaia.sites),
> Field('sortable', 'integer', default = 
> 0,writable=False,readable=False),
> singular = 'RouteDetail', plural = 'RouteDetails')
> 
>
>
> From the controller (making a link field for SQLForm.grid):
>
> 
> boxeslink = dict(
> header = 'Number of Boxes',
> body = lambda row: sum([x.site.NumBoxes for x in 
> row.routedetails.select()])
> )
> 
>
>
> I should be able to access related routedetails rows from a routes row. I 
> can't. I get an exception telling me that the  object doesn't have 
> that attribute.
>
>
> Sorry for the vague details-- I installed the new version, saw that it 
> didn't work, installed 1.99.7 and it worked perfectly again. I'll get a 
> 2.0.7 instance up and running later and can provide exact details.
>

-- 





[web2py] the ability to pass li class form response.menu could be useful with bootstrap

2012-10-02 Thread Richard
Hello,

Here html example of menu with bootstrap :



  **
  ** 
Accueil**
  
  

I found it very difficult to generate menu with the li in bold in the 
example above with MENU and response.menu, since li_class doesn't allow 
enough flexibility.

I don't think we can pass _class attribute in reponse.menu tuple, but it 
could help a lot in order to allow greater flexibility in the usage and 
integration with bootstrap.

Richard

-- 





[web2py] Re: Adding to derived smartgrid constraints.

2012-10-02 Thread Dominic Cioccarelli
Hi Massimo,

many thanks. Actually, the problem was when I tried to make a general 
example out of my business specific problem ;-) Before I "translated" my 
problem into an example, there was actually not a many-to-many 
relationship. For the purpose of this exercise, let's just assume that all 
options are specific to a car (which is the case in my real problem). 
Therefore model-option is now a 1:N relationship.

I did get the constraint query to work, but I was slightly surprised by 
what I needed to do. What finally worked was:

query = (db.model.option_id == db.option.id) & (db.option.name == 'Alloy 
Wheels')



Given that in my model, options were already related to models:

m3t.define_table('model',
Field('name'),
Field('make_id', db.make),
Field('option_id', db.option))

I would have expected to be able to do:

query = db.model.option.name == 'Alloy Wheels'

... but it complains that "option" isn't a valid field in "model".

In any case, it is working now but I still would have thought I could have 
simply recursed the object hierarchy to build the query (as per something 
like Hibernate).

Cheers,
Dominic.

On Tuesday, 2 October 2012 16:52:43 UTC+2, Massimo Di Pierro wrote:
>
> You have other problems before you solve this one.
>
> your model<->option is a one-to-many but should be a many-to-many (many 
> cars can have alloy-wheels and alloy-wheel is one of many possible options 
> for each car).
>
> Grid does now allow many-to-many very well but you can try:
>
>
> db.define_table('make',
> Field('name'))
>
> db.define_table('option',
> Field('name'))
>
> db.define_table('model',
> Field('name'),
> Field('make_id', db.make),
> Field('options', 'list:reference option'))
>
> Then I make a controller as follows:
>
> def index(): 
> query = db.model.options.contains(db.option(name='Alloy Wheels').id)
> constraints = {'model':query}
> grid = SQLFORM.smartgrid(db.make,constraints=constraints)
> return dict(grid=grid)
>
> On Tuesday, 2 October 2012 07:27:19 UTC-5, Dominic Cioccarelli wrote:
>>
>> I already posted this as a continuation of an existing question, but I 
>> figured it may be better to break it out into a separate thread...
>>
>> What happens if I want the constraint to add to the existing constraints 
>> that have been built by smartgrid? For example, if I have the model:
>>
>> db.define_table('make',
>> Field('name'))
>>
>> db.define_table('option',
>> Field('name'))
>>
>> m3t.define_table('model',
>> Field('name'),
>> Field('make_id', db.make),
>> Field('option_id', db.option))
>>
>> Then I make a controller as follows:
>>
>> def index():
>> grid = SQLFORM.smartgrid(db.make,constraints=constraints)
>> return dict(grid=grid)
>>
>> If I navigate to (for example)
>>
>> Alfa Romeo -> Gulia  (Gulia being a type of Alfa)
>>
>> And I want to only display Gulias with alloy wheels, which constraint 
>> should I define?
>>
>> If I define something like:
>>
>> query = option.name == 'Alloy Wheels'
>> constraints = {'model':query}
>>
>> ... I'll get all the cars (irrespective of make and model) that have 
>> alloy wheels. What I want is all the Alfa Romeo Gulias with Alloy Wheels. 
>> On the other hand I remove the constraint and navigate from "Alfa Romeo" to 
>> "Gulia" I'll get all Alfa Romo Gulias. What I need is a constraint that is 
>> *added* to the generated constraints.
>>
>> Many thanks in advance,
>> Dominic.
>>
>>

-- 





[web2py] Re: web2py 2.0.2 is out

2012-10-02 Thread Nate Atkinson
I seem to have run into a backwards compatibility issue.

This weekend, I did some system upgrades. I moved my web2py (1.99.7) + 
MySQL application off a single server running Ubuntu to two VM's running 
Debian stable (one VM for web2py + apache, one for MySQL). Web2py was 
deployed using the script in the deployment recipes book section (which 
downloaded whatever version was current as of Oct 1). MySQL data was moved 
using mysqldump.

It seems that one-to-many relations are broken in the DAL.

Example code snippets:

>From the model:


gaia.define_table('routes',
Field("Name", required=True),
Field("Active", "boolean", required=True, default=True),
format='%(Name)s')

gaia.define_table('routedetails',
Field('route', gaia.routes),
Field('site', gaia.sites),
Field('sortable', 'integer', default = 0,writable=False,readable=False),
singular = 'RouteDetail', plural = 'RouteDetails')



>From the controller (making a link field for SQLForm.grid):


boxeslink = dict(
header = 'Number of Boxes',
body = lambda row: sum([x.site.NumBoxes for x in 
row.routedetails.select()])
)



I should be able to access related routedetails rows from a routes row. I 
can't. I get an exception telling me that the  object doesn't have 
that attribute.


Sorry for the vague details-- I installed the new version, saw that it 
didn't work, installed 1.99.7 and it worked perfectly again. I'll get a 
2.0.7 instance up and running later and can provide exact details.

-- 





[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-02 Thread apps in tables
Browser : Chrome

On Tuesday, October 2, 2012 5:54:10 PM UTC+3, apps in tables wrote:
>
> Hi everybody,
>
> Let me describe the situation on the other side of the world.
>
> env : windows , web2py 2.0.9 stable
>
> application : has menus and submenus
>
> behaviour : 
>
> on starting page (hover over 
> menu shows the submenus )
> selecting submenu item that use smartgrid(hover over menu shows the 
> submenus )
> selecting submenu item that use SQLFORM  (hover over menu *does not show*the 
> submenus )
> returning back to the starting page (hover over menu shows 
> the submenus )
>
>
> I hope this will help in resolving the situation.
>
> Regards,
>
> Ashraf
>

-- 





Re: [web2py] Check upload file size before actual file data uploading

2012-10-02 Thread Massimo Di Pierro
You can try this:

In the upload form add 


def upload_page():
 ...
 length_bytes = cache.ram('X-Progress-ID:test:length',None,0)
 uploaded_bytes = cache.ram('X-Progress-ID:test:uploaded',None,0)
 ...

they are updated during the upload. Hope this helps.


On Tuesday, 2 October 2012 01:57:25 UTC-5, Johann Spies wrote:
>
> On 2 October 2012 04:20, Exeption > wrote:
>
>> Hi,
>>
>> Already have asked 
>> here,
>>  
>> but no reply.
>>
>> I will duplicate my question here:
>>
>> In my web2py controller I'm accessing file data like:
>>
>> vfile = request.post_vars.video.file
>>
>> But how can I check Content-Length *before* actual file data will be 
>> uploaded? It is not a good idea for me to check file size after file 
>> already uploaded.
>>
>> NOTE: I'm not using FORM() helper and database but just raw regular file 
>> upload. Is there any way to hook into web2py internals to do what I need?
>>
>>
> I suspect you will have to use javascript to do this.  I have just search 
> for 'javascript file size before upload'  and saw answers that should not 
> be too difficult to use in your case.
>
> Regards
> Johann
>
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>
>

-- 





[web2py] Re: exceptions.EOFError

2012-10-02 Thread Massimo Di Pierro
If you use trunk, please use the latest. I have no clue what was in trunk 
on 2012-9-25. I was running lots of tests. It says "stable" but that was 
trunk, not stable. 

Massimo

On Tuesday, 2 October 2012 08:11:52 UTC-5, mweissen wrote:
>
> I have got the following message - what does it mean?
>
>  Version  web2py™ (2, 0, 9, 
> datetime.datetime(2012, 9, 25, 16, 18, 48), 'stable')  Python Python 
> 2.7.3: /usr/bin/python  Traceback 
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "/users/www-data/web2py/gluon/restricted.py", line 209, in restricted
>
>
> exec ccode in environment
>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
> ,
>  line 1703, in 
>
>
>   File "/users/www-data/web2py/gluon/globals.py", line 186, in 
>
>
> self._caller = lambda f: f()
>
>
>   File "/users/www-data/web2py/applications/admin/controllers/default.py" 
> ,
>  line 1529, in ticket
>
>
> e.load(request, app, ticket)
>
>
>   File "/users/www-data/web2py/gluon/restricted.py", line 168, in load
>
>
> d = ticket_storage.load(request, app, ticket_id)
>
>
>   File "/users/www-data/web2py/gluon/restricted.py", line 96, in load
>
>
> return cPickle.load(ef)
> EOFError
>
>   Error snapshot [image: help]
>
> Regards, Martin
>

-- 





[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-02 Thread apps in tables
Hi everybody,

Let me describe the situation on the other side of the world.

env : windows , web2py 2.0.9 stable

application : has menus and submenus

behaviour : 

on starting page (hover over 
menu shows the submenus )
selecting submenu item that use smartgrid(hover over menu shows the 
submenus )
selecting submenu item that use SQLFORM  (hover over menu *does not show*the 
submenus )
returning back to the starting page (hover over menu shows 
the submenus )
   

I hope this will help in resolving the situation.

Regards,

Ashraf

-- 





[web2py] Re: Adding to derived smartgrid constraints.

2012-10-02 Thread Massimo Di Pierro
You have other problems before you solve this one.

your model<->option is a one-to-many but should be a many-to-many (many 
cars can have alloy-wheels and alloy-wheel is one of many possible options 
for each car).

Grid does now allow many-to-many very well but you can try:


db.define_table('make',
Field('name'))

db.define_table('option',
Field('name'))

db.define_table('model',
Field('name'),
Field('make_id', db.make),
Field('options', 'list:reference option'))

Then I make a controller as follows:

def index(): 
query = db.model.options.contains(db.option(name='Alloy Wheels').id)
constraints = {'model':query}
grid = SQLFORM.smartgrid(db.make,constraints=constraints)
return dict(grid=grid)

On Tuesday, 2 October 2012 07:27:19 UTC-5, Dominic Cioccarelli wrote:
>
> I already posted this as a continuation of an existing question, but I 
> figured it may be better to break it out into a separate thread...
>
> What happens if I want the constraint to add to the existing constraints 
> that have been built by smartgrid? For example, if I have the model:
>
> db.define_table('make',
> Field('name'))
>
> db.define_table('option',
> Field('name'))
>
> m3t.define_table('model',
> Field('name'),
> Field('make_id', db.make),
> Field('option_id', db.option))
>
> Then I make a controller as follows:
>
> def index():
> grid = SQLFORM.smartgrid(db.make,constraints=constraints)
> return dict(grid=grid)
>
> If I navigate to (for example)
>
> Alfa Romeo -> Gulia  (Gulia being a type of Alfa)
>
> And I want to only display Gulias with alloy wheels, which constraint 
> should I define?
>
> If I define something like:
>
> query = option.name == 'Alloy Wheels'
> constraints = {'model':query}
>
> ... I'll get all the cars (irrespective of make and model) that have alloy 
> wheels. What I want is all the Alfa Romeo Gulias with Alloy Wheels. On the 
> other hand I remove the constraint and navigate from "Alfa Romeo" to 
> "Gulia" I'll get all Alfa Romo Gulias. What I need is a constraint that is 
> *added* to the generated constraints.
>
> Many thanks in advance,
> Dominic.
>
>

-- 





[web2py] Re: Need help... testing new DAL

2012-10-02 Thread João Saraiva
More on this problem...

I was able to overcome the "cannot duplicate a singleton" error by 
explicitly closing each db on the tests' tearDown:
-

db.close(action=None)
-
I needed to include action=None, otherwise I'd get the following error:
-
Traceback (most recent call last):
  File "/stuff/web2py/applications/me_app/tests/controllers/__init__.py", 
line 21, in tearDown
db.close()
  File "/stuff/web2py/gluon/dal.py", line 7148, in close
adapter.close()
  File "/stuff/web2py/gluon/dal.py", line 505, in close
getattr(self, action)()
  File "/stuff/web2py/gluon/dal.py", line 1643, in commit
return self.connection.commit()
AttributeError: 'NoneType' object has no attribute 'commit'
-

However, I still have the "invalid tablename" exception.

Best regards

On Tuesday, October 2, 2012 12:54:52 PM UTC+1, João Saraiva wrote:
>
> Hello,
>
> I am having problems with the new Singleton DAL feature and a web-app that 
> I had already working correctly with web2py.
>
> Although the web-app itself runs ok (I can navigate the browser to it, and 
> the app runs without issues when used from the browser), it crashes when I 
> run unit-tests on it (by means of web2py.test-runner). More specifically, 
> each test crashes with the following stack trace:
> -
> Traceback (most recent call last):
>   File "/stuff/web2py/gluon/restricted.py", line 209, in restricted
> exec ccode in environment
>   File "/stuff/web2py/applications/me_app/models/00_app_config.py", line 
> 61, in 
> initialize = Initialization(settings, T, request, response, session, 
> cache)
>   File "/stuff/web2py/applications/me_app/modules/model_logic/config.py", 
> line 53, in __init__
> (db, archival_db, scheduler_db) = self.__init_db()
>   File "/stuff/web2py/applications/me_app/modules/model_logic/config.py", 
> line 88, in __init_db
> check_reserved=check_reserved)
>   File "/stuff/web2py/gluon/dal.py", line 6595, in __new__
> raise RuntimeError, 'Cannot duplicate a Singleton'
> RuntimeError: Cannot duplicate a Singleton
> -
>
> The statement that makes this crash is:
> -
> db = DAL(
> settings.db_uri if not request.is_testing else 
> 'sqlite:memory:',
> migrate_enabled=settings.migrate or request.is_testing,
> lazy_tables=True,
> #bigint_id=True, # TODO
> check_reserved=check_reserved)
> -
> I also create other databases after db that, in testing mode, also point 
> to 'sqlite:memory'. If I comment those other databases out, the first test 
> passes ok, but the other ones still crash.
>
> If I try to comment the lines that originate this error (
> http://code.google.com/p/web2py/source/browse/gluon/dal.py#6594 and 
> http://code.google.com/p/web2py/source/browse/gluon/dal.py#6595), then I 
> get an error when creating the first table in my db:
> -
> Traceback (most recent call last):
>   File "/stuff/web2py/gluon/restricted.py", line 209, in restricted
> exec ccode in environment
>   File "/stuff/web2py/applications/me_app/models/08_domain.py", line 14, 
> in 
> current.domain = domain = domain_model.define_domain()
>   File 
> "/stuff/web2py/applications/me_app/modules/model_logic/domain_model.py", 
> line 334, in define_domain
> domain=domain)
>   File 
> "/stuff/web2py/applications/me_app/modules/model_logic/domain_model.py", 
> line 665, in __define_core
> on_define=init_domain__country,
>   File "/stuff/web2py/gluon/dal.py", line 7034, in define_table
> raise SyntaxError, 'invalid table name: %s' % tablename
> SyntaxError: invalid table name: country
> -
> which appears to be the same error message that has been reported by 
> others (
> https://groups.google.com/d/msg/web2py-developers/CWxEhcWxiGM/-Aw_fhQQY4EJ
> ).
>
> When I revert to r4184, everything runs peachy.
>
> Looking at the code for DAL, I am led to believe that this may have 
> something to do with threading. Is there any way to disable the Singleton 
> DAL feature selectively (at least for unit-testing, which does not use 
> threading in the same manner as web containers do)?
>
> Best regards,
> JS
>
>
> On Tuesday, October 2, 2012 3:32:16 AM UTC+1, Massimo Di Pierro wrote:
>>
>> There is a big change in DAL.
>>
>> a = DAL(uri)
>> b = DAL(uri)
>>
>> now "a is b" because DAL is a singleton (almost). It is a thread local 
>> singleton as long a uri is specified.
>> What does this mean in practice?
>>
>> It means that unless you have lazy virtual fields, Row and Rows objects 
>> can be serialized (pickled), properly cached, and stored in session.
>> For example:
>>
>> session.rows = session.rows or db(db.mytable).select()
>>
>> and you can still do:
>>
>> session.rows.first().update_record()
>>
>> has many practical implications in the way you program and there is even 
>> more we could do. In the future we may be able to serialize every DAL 

[web2py] exceptions.EOFError

2012-10-02 Thread Martin Weissenboeck
I have got the following message - what does it mean?

 Version  web2py™ (2, 0, 9,
datetime.datetime(2012, 9, 25, 16, 18, 48), 'stable')  Python Python 2.7.3:
/usr/bin/python  Traceback


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


Traceback (most recent call last):
  File "/users/www-data/web2py/gluon/restricted.py", line 209, in restricted

exec ccode in environment
  File "/users/www-data/web2py/applications/admin/controllers/default.py"
,
line 1703, in 

  File "/users/www-data/web2py/gluon/globals.py", line 186, in 

self._caller = lambda f: f()

  File "/users/www-data/web2py/applications/admin/controllers/default.py"
,
line 1529, in ticket

e.load(request, app, ticket)

  File "/users/www-data/web2py/gluon/restricted.py", line 168, in load

d = ticket_storage.load(request, app, ticket_id)

  File "/users/www-data/web2py/gluon/restricted.py", line 96, in load

return cPickle.load(ef)
EOFError

  Error snapshot [image: help]

Regards, Martin

-- 





[web2py] Adding to derived smartgrid constraints.

2012-10-02 Thread Dominic Cioccarelli
I already posted this as a continuation of an existing question, but I 
figured it may be better to break it out into a separate thread...

What happens if I want the constraint to add to the existing constraints 
that have been built by smartgrid? For example, if I have the model:

db.define_table('make',
Field('name'))

db.define_table('option',
Field('name'))

m3t.define_table('model',
Field('name'),
Field('make_id', db.make),
Field('option_id', db.option))

Then I make a controller as follows:

def index():
grid = SQLFORM.smartgrid(db.make,constraints=constraints)
return dict(grid=grid)

If I navigate to (for example)

Alfa Romeo -> Gulia  (Gulia being a type of Alfa)

And I want to only display Gulias with alloy wheels, which constraint 
should I define?

If I define something like:

query = option.name == 'Alloy Wheels'
constraints = {'model':query}

... I'll get all the cars (irrespective of make and model) that have alloy 
wheels. What I want is all the Alfa Romeo Gulias with Alloy Wheels. On the 
other hand I remove the constraint and navigate from "Alfa Romeo" to 
"Gulia" I'll get all Alfa Romo Gulias. What I need is a constraint that is *
added* to the generated constraints.

Many thanks in advance,
Dominic.

-- 





[web2py] Re: Need help... testing new DAL

2012-10-02 Thread João Saraiva
Hello,

I am having problems with the new Singleton DAL feature and a web-app that 
I had already working correctly with web2py.

Although the web-app itself runs ok (I can navigate the browser to it, and 
the app runs without issues when used from the browser), it crashes when I 
run unit-tests on it (by means of web2py.test-runner). More specifically, 
each test crashes with the following stack trace:
-
Traceback (most recent call last):
  File "/stuff/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File "/stuff/web2py/applications/me_app/models/00_app_config.py", line 
61, in 
initialize = Initialization(settings, T, request, response, session, 
cache)
  File "/stuff/web2py/applications/me_app/modules/model_logic/config.py", 
line 53, in __init__
(db, archival_db, scheduler_db) = self.__init_db()
  File "/stuff/web2py/applications/me_app/modules/model_logic/config.py", 
line 88, in __init_db
check_reserved=check_reserved)
  File "/stuff/web2py/gluon/dal.py", line 6595, in __new__
raise RuntimeError, 'Cannot duplicate a Singleton'
RuntimeError: Cannot duplicate a Singleton
-

The statement that makes this crash is:
-
db = DAL(
settings.db_uri if not request.is_testing else 'sqlite:memory:',
migrate_enabled=settings.migrate or request.is_testing,
lazy_tables=True,
#bigint_id=True, # TODO
check_reserved=check_reserved)
-
I also create other databases after db that, in testing mode, also point to 
'sqlite:memory'. If I comment those other databases out, the first test 
passes ok, but the other ones still crash.

If I try to comment the lines that originate this error 
(http://code.google.com/p/web2py/source/browse/gluon/dal.py#6594 
and http://code.google.com/p/web2py/source/browse/gluon/dal.py#6595), then 
I get an error when creating the first table in my db:
-
Traceback (most recent call last):
  File "/stuff/web2py/gluon/restricted.py", line 209, in restricted
exec ccode in environment
  File "/stuff/web2py/applications/me_app/models/08_domain.py", line 14, in 

current.domain = domain = domain_model.define_domain()
  File 
"/stuff/web2py/applications/me_app/modules/model_logic/domain_model.py", 
line 334, in define_domain
domain=domain)
  File 
"/stuff/web2py/applications/me_app/modules/model_logic/domain_model.py", 
line 665, in __define_core
on_define=init_domain__country,
  File "/stuff/web2py/gluon/dal.py", line 7034, in define_table
raise SyntaxError, 'invalid table name: %s' % tablename
SyntaxError: invalid table name: country
-
which appears to be the same error message that has been reported by others 
(https://groups.google.com/d/msg/web2py-developers/CWxEhcWxiGM/-Aw_fhQQY4EJ).

When I revert to r4184, everything runs peachy.

Looking at the code for DAL, I am led to believe that this may have 
something to do with threading. Is there any way to disable the Singleton 
DAL feature selectively (at least for unit-testing, which does not use 
threading in the same manner as web containers do)?

Best regards,
JS


On Tuesday, October 2, 2012 3:32:16 AM UTC+1, Massimo Di Pierro wrote:
>
> There is a big change in DAL.
>
> a = DAL(uri)
> b = DAL(uri)
>
> now "a is b" because DAL is a singleton (almost). It is a thread local 
> singleton as long a uri is specified.
> What does this mean in practice?
>
> It means that unless you have lazy virtual fields, Row and Rows objects 
> can be serialized (pickled), properly cached, and stored in session.
> For example:
>
> session.rows = session.rows or db(db.mytable).select()
>
> and you can still do:
>
> session.rows.first().update_record()
>
> has many practical implications in the way you program and there is even 
> more we could do. In the future we may be able to serialize every DAL 
> expression.
>
> This is a big change in the source and the internal logic is complex. 
> It may have some unforeseen side effects.
> PLEASE TEST THAT TRUNK DOES NOT BREAK YOUR CODE before this makes it into 
> stable.
>
> massimo
>
>
>
>
>
>

-- 





Re: [web2py] Need help... testing new DAL

2012-10-02 Thread Johann Spies
On 2 October 2012 04:32, Massimo Di Pierro wrote:

>
> This is a big change in the source and the internal logic is complex.
> It may have some unforeseen side effects.
> PLEASE TEST THAT TRUNK DOES NOT BREAK YOUR CODE before this makes it into
> stable.
>

I am using postgresql as backend.

On an existing app with no changes to the database or db-related code I did
not experience problems.

Then I tried to connect to a database with existing tables using
'migrate=False,fake_migrate=True'  and had problems with web2py hanging.
I had to kill the process with kill -9.

I then deleted and recreated an empty database in postgresql. I forgot to
take out the above-mentioned migrate-code which created a ticket.  After I
corrected the code, web2py hung again and had to be force-killed.

I then reverted to -r4202 and everything worked as expected.

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

-- 





Re: [web2py] How do you I use geo-spatial types in Web2py DAL?

2012-10-02 Thread Manuele Pesenti

Il 02/10/2012 04:48, Massimo Di Pierro ha scritto:
I believe the spatial DAL only supports postgresql/postGIS and 
sqlite/spatialite. It does not support mysql.


well... I forgot to specify that I have tested with postgis... you can 
look inside the dal.py file wich are the db drive that support the 
geometry field type. But I think Massimo got right.


It could be usefull to start some doc page about gis support. :)

M.

--





Re: [web2py] Re: SQLFORM.grid + GAE

2012-10-02 Thread David Sorrentino
Fixed in trunk. Thanks Massimo!

Cheers,
David


On 2 October 2012 04:48, Massimo Di Pierro wrote:

> I believe this is fixed in trunk. Can you help test it?
>
>
> On Sunday, 30 September 2012 13:08:10 UTC-5, David Sorrentino wrote:
>
>> Sure I can! ;)
>>
>> Here it is:
>>
>> ERROR2012-09-30 18:04:57,520 restricted.py:54] In FILE:
>>> /home/dapids/webdev/**backinterface/web2py/**applications/backinterface/
>>> **controllers/default.py
>>>
>>> Traceback (most recent call last):
>>>   File "/home/dapids/webdev/**backinterface/web2py/gluon/**restricted.py",
>>> line 209, in restricted
>>> exec ccode in environment
>>>   File "/home/dapids/webdev/**backinterface/web2py/**
>>> applications/backinterface/**controllers/default.py", line 86, in
>>> 
>>>   File "/home/dapids/webdev/**backinterface/web2py/gluon/**globals.py",
>>> line 186, in 
>>> self._caller = lambda f: f()
>>>   File "/home/dapids/webdev/**backinterface/web2py/**
>>> applications/backinterface/**controllers/default.py", line 24, in
>>> editnews
>>> grid = SQLFORM.grid(db.news)
>>>   File "/home/dapids/webdev/**backinterface/web2py/gluon/**sqlhtml.py",
>>> line 2042, in grid
>>> cacheable=True,*table_fields)
>>>   File "/home/dapids/webdev/**backinterface/web2py/gluon/**dal.py",
>>> line 8719, in select
>>> return adapter.select(self.query,**fields,attributes)
>>>   File "/home/dapids/webdev/**backinterface/web2py/gluon/**dal.py",
>>> line 4546, in select
>>> for t in fields] for item in items]
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**ext/db/__init__.py",
>>> line 2082, in __iter__
>>> return self.run()
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**ext/db/__init__.py",
>>> line 2063, in run
>>> raw_query = self._get_query()
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**ext/db/__init__.py",
>>> line 2459, in _get_query
>>> _app=self._app)
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**api/datastore.py",
>>> line 1315, in __init__
>>> self.update(filters)
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**api/datastore.py",
>>> line 1764, in update
>>> self.__setitem__(filter, value)
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**api/datastore.py",
>>> line 1708, in __setitem__
>>> match = self._CheckFilter(filter, value)
>>>   File 
>>> "/home/dapids/google_**appengine/google/appengine/**api/datastore.py",
>>> line 1847, in _CheckFilter
>>> (datastore_types.KEY_SPECIAL_**PROPERTY, value, typename(value)))
>>> BadFilterError: invalid filter: __key__ filter value must be a Key;
>>> received None (a NoneType).
>>>
>>
>> Thanks for your help Massimo.
>>
>> Cheers,
>> David
>>
>>
>> On 30 September 2012 19:40, Massimo Di Pierro wrote:
>>
>>> Can you please post the entire traceback?
>>>
>>> Massimo
>>>
>>>
>>> On Sunday, 30 September 2012 11:52:57 UTC-5, David Sorrentino wrote:

 Hi there! :)

 I'm trying to exploit the power of SQLFORM.grid with GAE but I'm having
 some troubles.
 All I want to do is to have a grid from a table (seems to be simple
 reading the infinite examples on the web).

 Here my table definition:

 db.define_table('news',
> Field('title'),
> Field('body', 'text')
> )
>

 Here the controller:

 @auth.requires_login()
> def editnews():
> grid = SQLFORM.grid(db.news)
> return dict(grid=grid)
>

 And here the view:

  {{extend 'layout.html'}}
> {{=grid}}
>

 Unfortunately when I load the view I get this error:

 BadFilterError: invalid filter: __key__ filter value must be a Key;
> received None (a NoneType).
>

 The errors seems to be in the definition of the grid, but I can't
 understand what's wrong.
 Can somebody help me? :)

 Cheers,
 David

>>>  --
>>>
>>>
>>>
>>>
>>
>>  --
>
>
>
>

--