[web2py] Re: Globals.py Bad Request

2013-11-28 Thread Massimo Di Pierro
I think your action is missing a return value:

@auth.requires_membership("secretaria")
def turmas():
campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
alunos.serie_turma]
form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
"alunos.nome")
return dict(form=form)

I am not sure whether this is causing your problem. Something else may be 
going on.


On Thursday, 28 November 2013 14:55:50 UTC-6, Leonardo Pires Felix wrote:
>
> Sorry for my english.
> Hi there, i've this simple sqlform.grid:
> @auth.requires_membership("secretaria")
> def turmas():
> campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
> alunos.serie_turma]
> form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
> "alunos.nome")
>
> I've used the pc on the school to try to update one field of the row, It 
> raises the error. Add a row give me the same error. 
> When i came home and used my personal pc everything went smooth.
>
> The error wasn't tracked by the web2py, only the apache error log.
> Error stack:
>
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] Traceback (most 
> recent call last):
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
> "/home/leonardo/homes/web2py/gluon/main.py", line 532, in wsgibase
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] if request.body:
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
> "/home/leonardo/homes/web2py/gluon/globals.py", line 252, in body
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] raise HTTP(400, 
> "Bad Request - HTTP body is incomplete")
> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] HTTP: 400 BAD 
> REQUEST
>
>
> I want to know if, it is a browser/system problem on the request, or 
> something else. I didn't found any glue about this.
> On the school, i've tried to use both chrome and IE 7 or >. The OS is 
> windows xp.
> On my home, everything worked, I'm using win 7 with both ie 11 and firefox 
> 25. And Debian 7 with iceweasel and chromium.
>
>

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


[web2py] Re: Globals.py Bad Request

2013-11-29 Thread Leonardo Pires Felix
It have a return on the file, i've deleted the comment on code to put here 
and deleted the return too by mistake. Here is complete code. The same that 
is having the issue:
@auth.requires_membership("secretaria")
def turmas():
campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
alunos.serie_turma]
#link_campos = [dict(header=A("Serie/Turma"),body=lambda linha: "%sÂȘ%s" 
% (db.alunos[linha.id].serie,db.alunos[linha.id].turma))]
form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
"alunos.nome")
return dict(saida=form)

Em sexta-feira, 29 de novembro de 2013 05h08min35s UTC-2, Massimo Di Pierro 
escreveu:
>
> I think your action is missing a return value:
>
> @auth.requires_membership("secretaria")
> def turmas():
> campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
> alunos.serie_turma]
> form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
> "alunos.nome")
> return dict(form=form)
>
> I am not sure whether this is causing your problem. Something else may be 
> going on.
>
>
> On Thursday, 28 November 2013 14:55:50 UTC-6, Leonardo Pires Felix wrote:
>>
>> Sorry for my english.
>> Hi there, i've this simple sqlform.grid:
>> @auth.requires_membership("secretaria")
>> def turmas():
>> campos = [db.alunos.id,db.alunos.nome,db.alunos.nome_responsavel,db.
>> alunos.serie_turma]
>> form = SQLFORM.grid(db.alunos,fields=campos,deletable=False,orderby=
>> "alunos.nome")
>>
>> I've used the pc on the school to try to update one field of the row, It 
>> raises the error. Add a row give me the same error. 
>> When i came home and used my personal pc everything went smooth.
>>
>> The error wasn't tracked by the web2py, only the apache error log.
>> Error stack:
>>
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] Traceback (most 
>> recent call last):
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
>> "/home/leonardo/homes/web2py/gluon/main.py", line 532, in wsgibase
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] if 
>> request.body:
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10]   File 
>> "/home/leonardo/homes/web2py/gluon/globals.py", line 252, in body
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] raise 
>> HTTP(400, "Bad Request - HTTP body is incomplete")
>> [Thu Nov 28 15:21:40 2013] [error] [client 200.101.76.10] HTTP: 400 BAD 
>> REQUEST
>>
>>
>> I want to know if, it is a browser/system problem on the request, or 
>> something else. I didn't found any glue about this.
>> On the school, i've tried to use both chrome and IE 7 or >. The OS is 
>> windows xp.
>> On my home, everything worked, I'm using win 7 with both ie 11 and 
>> firefox 25. And Debian 7 with iceweasel and chromium.
>>
>>

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