[web2py] Header for selectable

2013-08-15 Thread Leonardo Pires Felix
How put a header on selectable column on SQLFORM.grid?

-- 

--- 
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] Date search on sqlform.grid not working

2013-08-17 Thread Leonardo Pires Felix
Hi, I'm trying to do a search by date with sqlform.grid. But it is not 
returning the right date.
There is a picture on attachment of the issue.

-- 

--- 
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: Date search on sqlform.grid not working

2013-08-17 Thread Leonardo Pires Felix
I've found something, when i do the search using the date picker, it 
returns me in the format of the translation file("%d/%m/%Y"), but when use 
like this to do the search, it returns nothing or something not expected. 
But if i mannually change the format from the search on the sqlform.grid to 
"%Y/%m/%d" it works out. How do to the sqlform.grid recognize the format 
that i want to use on the search("%d/%m/%Y") ?

-- 

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

2014-03-07 Thread Leonardo Pires Felix
Looks like that this is happening with the REDIS too, Upgraded from 2.8.3 
to 2.9.4 And the error persist.

Traceback (most recent call last):
  File "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/restricted.py", 
line 217, in restricted
exec ccode in environment
  File 
"/home/leonardo/domains/cef03.com/arquivos/web2py/applications/cef03/models/db.py"
 , line 62, in 
session.connect(request, response, db = sessiondb)
  File "/home/leonardo/domains/cef03.com/arquivos/web2py/gluon/globals.py", 
line 883, in connect
row = table(record_id, unique_key=unique_key)
TypeError: __call__() got an unexpected keyword argument 'unique_key'





Em terça-feira, 4 de março de 2014 19h37min17s UTC-3, Sebastian Cambeo 
escreveu:
>
> I can only provide assistance for the "unique key error":
> line 883: https://github.com/web2py/web2py/blame/master/gluon/globals.py:
> dee4e6a9
>  
> »
>  
> mdipierro  
> 2013-08-20 new session logic 
>
>
> I don't know how the "int64 too big" error was introduced
>
>
>
> Am Dienstag, 4. März 2014 22:29:56 UTC+1 schrieb Massimo Di Pierro:
>>
>> can you provide a patch or a revision number that broke it?
>>
>> On Saturday, 1 March 2014 12:25:14 UTC-6, Bas Ti wrote:
>>>
>>> The current trunk does not support using memcache as session store on 
>>> GAE:
>>> session.connect calls memdb.Table.__call__(recordid, 
>>> unique_key=unique_key)
>>>
>>> however unique_key is not supported by memdb.Table, it is only supported 
>>> by dal.Table
>>>
>>

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


[web2py] ExportClasses on grid

2014-03-16 Thread Leonardo Pires Felix
Hi,
There is how change the default exportclasses on web2py without modify in 
the code of web2py, and without expliciting it in all my grids?
I didn't found anything.

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


[web2py] Virtual Field not working anymore?

2014-05-03 Thread Leonardo Pires Felix

I've created a virtualfield on my table as this:
db.define_table("alunos",
  SQLField("nome", "string", length=255, label="Nome", notnull=True, 
requires=IS_UPPER())
  SQLField("data_nascimento", "date", label="Data de 
nascimento",represent=campoDataNascimento, notnull=True),
  SQLField.Virtual('mediaFreq',lambda linha: 
db(db.entrada_cartao_alunos.id_aluno == 
linha.aluno.id).count()+db(db.faltas_alunos.id_aluno == 
linha.aluno.id).count())
  )
  singular="Aluno",
  plural="Alunos",
  format="%(nome)s")

And on the smartgrid the virtual field doesn't show.

I've tried from command line, but:
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/leonardo/domains/homo.com/arquivos/web2py/gluon/dal.py", line 
7343, in __getitem__
raise ae
AttributeError: 'Row' object has no attribute 'mediaFreq'

But on dir(db.alunos) the virtualfield is there, on db.alunos.fields isn't.
So, the virtualfield isn't working anymore?

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


[web2py] Export limit

2014-07-31 Thread Leonardo Pires Felix
There is a clever way to limit the number of rows passed to exporter class?
The easy way i see is in limiting on the query, but on that way the user 
will cannot search on the rows that isn't included on the search.
There is a way to only limit the export?

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


[web2py] Re: admin page is not working in web2py 2.7.4

2013-10-18 Thread Leonardo Pires Felix
Same thing here, even with the new alias and restarting apache the admin 
doesn't look as it should be.

Em quinta-feira, 17 de outubro de 2013 21h01min50s UTC-3, frasse escreveu:
>
> I have restart my apache. The only change I have in my web2py configration 
> is in routes.py and it is like this
>
> routers = dict(
>
> # base router
> BASE = dict(
> default_application = 'myapp',
>  default_controller = 'start',
> ),
> )
>
>
> can this be a problem ?
>
> Thanks
> /F
>
> Den torsdagen den 17:e oktober 2013 kl. 21:17:14 UTC+2 skrev Niphlod:
>>
>> you have some other error elsewhere or you didn't restart apache after 
>> the change. It works flawlessly.
>>
>> On Thursday, October 17, 2013 11:24:47 AM UTC+2, frasse wrote:
>>>
>>> Hi Niphlop
>>> It is not working for me.
>>> I change AliasMatch to this
>>> Ange   AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) \
>>>/var/web2py/applications/$1/static/$2
>>>
>>>   
>>> Order Allow,Deny
>>> Allow from all
>>>   
>>>
>>> koden här...
>>> Bu I have to remove 
>>>
>>> https://github.com/web2py/web2py/blob/master/applications/admin/models/0.py#L84
>>>
>>> To make it work . do you see any error in my config example
>>> Thanks
>>> /F
>>>
>>> Den torsdagen den 17:e oktober 2013 kl. 06:50:42 UTC+2 skrev Mark 
>>> Abajian:

 Thank you for the explanation, Niphlod.  I've updated my AliasMatch, 
 and that is working for me.

 Mark Abajian

 On Wednesday, October 16, 2013 12:07:53 PM UTC-7, Niphlod wrote:
>
>
> AliasMatch 
> ^/([^/]+)/static/*(?:_[\d]+.[\d]+.[\d]+/)?*(.*)/home/www-data/web2py/applications/
> $1/static/$2
>
> The *bold red *part is what has been "added" to web2py's scripts to 
> make apache serve the same file if there is a _number.number.number 
> "prefix" just right after "static".
> Frasse
>


-- 
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] Globals.py Bad Request

2013-11-28 Thread Leonardo Pires Felix
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.


[web2py] Label as column name on export grid

2013-12-18 Thread Leonardo Pires Felix
Hi, there is how export the grid with the label of the field? Or do i need 
to do a workaround?
Since on tsv that uses represent and all on the export, it doesn't use the 
labels as export way.

-- 
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] Get label of field

2014-01-11 Thread Leonardo Pires Felix
I'm tryng to make the export classes export with fieldlabel instead of 
dbname.field.
So i'm seeing that should be here where i should change:

writer.writerow(
[unicode(col).encode 
("utf8")
 for col in self.rows 
.colnames])
 

My doubt is, how i get the labels of specific field, or a group of fields, 
or all fields?

-- 
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] Return object from represent method of field

2015-02-16 Thread Leonardo Pires Felix
Hi, when i return a XML from the represent, it gives me a error.
Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.

Traceback (most recent call last):
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/restricted.py", 
line 224, in restricted
exec ccode in environment
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
 , line 771, in 

  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/globals.py", line 
393, in 
self._caller = lambda f: f()
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/tools.py", line 
3444, in f
return action(*a, **b)
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
 , line 416, in 
entradas
exportclasses=classeExportar, 
orderby=~db.entrada_cartao_alunos.horario_entrada)
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/sqlhtml.py", line 
2661, in grid
value = field.formatter(value)
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/dal/objects.py", 
line 1636, in formatter
value = item.formatter(value)
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/validators.py", 
line 2373, in formatter
year = value.year
AttributeError: 'XML' object has no attribute 'year'


But when i remove the XML, it gives me no error. So, The represent of the 
field has limitation?
I'm tryng to return a attr html type.
That's the content of the represent method
dt_str = valor.strftime("%H:%M:%S %d/%m/%Y")
return XML('%s' % (valor.strftime("%A").title(), 
dt_str))


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


[web2py] Re: Return object from represent method of field

2015-02-17 Thread Leonardo Pires Felix


Also, there is a way to represent two types, text and html?

For example, if i want to make a tooltip of a date fiel, to make things 
clean and easy for the user, I would do:

<https://lh5.googleusercontent.com/-SPmSRMlcTjU/VOP4g-v2c6I/Afg/WnJ4hsfiaek/s1600/exemplo.png>

That is a the return of the represent field:

dt_str = valor.strftime("%d/%m/%Y")
return SPAN(dt_str, **{'_data-toggle': "tooltip",
   '_data-placement': "top",
   '_title': valor.strftime("%A").title()})

But if i try to export that. I'll get the html on the export file.

There is a way to separate the HTML of the text that will be represented in 
export? Like a represent_html and represent_text?

Em terça-feira, 17 de fevereiro de 2015 16:02:20 UTC-2, Massimo Di Pierro 
escreveu:
>
> I just fixed this in trunk and I will rebuilding the new nightly built, 
> try in 1h.
>
> On Monday, 16 February 2015 21:08:31 UTC-6, Leonardo Pires Felix wrote:
>>
>> Hi, when i return a XML from the represent, it gives me a error.
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>>
>> Traceback (most recent call last):
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/restricted.py", 
>> line 224, in restricted
>> exec ccode in environment
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 771, 
>> in 
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/globals.py", 
>> line 393, in 
>> self._caller = lambda f: f()
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/tools.py", line 
>> 3444, in f
>> return action(*a, **b)
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 416, 
>> in entradas
>> exportclasses=classeExportar, 
>> orderby=~db.entrada_cartao_alunos.horario_entrada)
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/sqlhtml.py", 
>> line 2661, in grid
>> value = field.formatter(value)
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/dal/objects.py", line 
>> 1636, in formatter
>> value = item.formatter(value)
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/validators.py", 
>> line 2373, in formatter
>> year = value.year
>> AttributeError: 'XML' object has no attribute 'year'
>>
>>
>> But when i remove the XML, it gives me no error. So, The represent of the 
>> field has limitation?
>> I'm tryng to return a attr html type.
>> That's the content of the represent method
>> dt_str = valor.strftime("%H:%M:%S %d/%m/%Y")
>> return XML('%s' % (valor.strftime("%A").title(), 
>> dt_str))
>>
>>
>>

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


[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-02-20 Thread Leonardo Pires Felix
Hello,

Please add us:
Corporate name: Leonardo Pires Felix - ME
Trade name: LPFX 
website: http://lpfx.com.br

Web2py about in http://lpfx.com.br/software, where we tell about the 
software that we use.

Em domingo, 15 de fevereiro de 2015 20:21:36 UTC-2, Massimo Di Pierro 
escreveu:
>
> We need to update the list of companies that provide web2py consulting.
> This list is obsolete:
>
> http://web2py.com/init/default/support
>
> Some links are broke. Most pages do not even mention web2py. Some of them 
> have a design that is simply not acceptable for a web development company.
>
> That list will be eliminated. IF YOU WANT TO BE LISTED please update your 
> page to have a decent design and MENTION WEB2PY on the main site. Then 
> respond to this thread by providing an updated link and the country were 
> you incorporated. If you have a self-employed individual list your country 
> of residence.
>
>

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


[web2py] Re: Return object from represent method of field

2015-02-21 Thread Leonardo Pires Felix
There is how make a widget only for represent the field on html? like to 
the user to see a field with a tooltip, with the span element that i've 
show above, without making the export classes get the represented(html) 
inside the .csv,txt etc..?

Em terça-feira, 17 de fevereiro de 2015 16:02:20 UTC-2, Massimo Di Pierro 
escreveu:
>
> I just fixed this in trunk and I will rebuilding the new nightly built, 
> try in 1h.
>
> On Monday, 16 February 2015 21:08:31 UTC-6, Leonardo Pires Felix wrote:
>>
>> Hi, when i return a XML from the represent, it gives me a error.
>> Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>>
>> Traceback (most recent call last):
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/restricted.py", 
>> line 224, in restricted
>> exec ccode in environment
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 771, 
>> in 
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/globals.py", 
>> line 393, in 
>> self._caller = lambda f: f()
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/tools.py", line 
>> 3444, in f
>> return action(*a, **b)
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 416, 
>> in entradas
>> exportclasses=classeExportar, 
>> orderby=~db.entrada_cartao_alunos.horario_entrada)
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/sqlhtml.py", 
>> line 2661, in grid
>> value = field.formatter(value)
>>   File 
>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/dal/objects.py", line 
>> 1636, in formatter
>> value = item.formatter(value)
>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/validators.py", 
>> line 2373, in formatter
>> year = value.year
>> AttributeError: 'XML' object has no attribute 'year'
>>
>>
>> But when i remove the XML, it gives me no error. So, The represent of the 
>> field has limitation?
>> I'm tryng to return a attr html type.
>> That's the content of the represent method
>> dt_str = valor.strftime("%H:%M:%S %d/%m/%Y")
>> return XML('%s' % (valor.strftime("%A").title(), 
>> dt_str))
>>
>>
>>

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


[web2py] Re: Return object from represent method of field

2015-02-21 Thread Leonardo Pires Felix
I think, like the represented of the widget of the field. But i've seen it 
just works with upload. If extend it to allow to other types to represent 
with custom html(like a tooltip in my case)

Em sábado, 21 de fevereiro de 2015 15:06:13 UTC-2, Leonardo Pires Felix 
escreveu:
>
> There is how make a widget only for represent the field on html? like to 
> the user to see a field with a tooltip, with the span element that i've 
> show above, without making the export classes get the represented(html) 
> inside the .csv,txt etc..?
>
> Em terça-feira, 17 de fevereiro de 2015 16:02:20 UTC-2, Massimo Di Pierro 
> escreveu:
>>
>> I just fixed this in trunk and I will rebuilding the new nightly built, 
>> try in 1h.
>>
>> On Monday, 16 February 2015 21:08:31 UTC-6, Leonardo Pires Felix wrote:
>>>
>>> Hi, when i return a XML from the represent, it gives me a error.
>>> Traceback
>>>
>>> 1.
>>> 2.
>>> 3.
>>> 4.
>>> 5.
>>> 6.
>>> 7.
>>> 8.
>>> 9.
>>> 10.
>>> 11.
>>> 12.
>>> 13.
>>> 14.
>>> 15.
>>> 16.
>>> 17.
>>> 18.
>>>
>>> Traceback (most recent call last):
>>>   File 
>>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/restricted.py", line 
>>> 224, in restricted
>>> exec ccode in environment
>>>   File 
>>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 
>>> 771, in 
>>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/globals.py", 
>>> line 393, in 
>>> self._caller = lambda f: f()
>>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/tools.py", 
>>> line 3444, in f
>>> return action(*a, **b)
>>>   File 
>>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/applications/gie/controllers/secretaria.py"
>>>  <http://127.0.0.1:8000/admin/edit/gie/controllers/secretaria.py>, line 
>>> 416, in entradas
>>> exportclasses=classeExportar, 
>>> orderby=~db.entrada_cartao_alunos.horario_entrada)
>>>   File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/sqlhtml.py", 
>>> line 2661, in grid
>>> value = field.formatter(value)
>>>   File 
>>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/dal/objects.py", line 
>>> 1636, in formatter
>>> value = item.formatter(value)
>>>   File 
>>> "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/validators.py", line 
>>> 2373, in formatter
>>> year = value.year
>>> AttributeError: 'XML' object has no attribute 'year'
>>>
>>>
>>> But when i remove the XML, it gives me no error. So, The represent of 
>>> the field has limitation?
>>> I'm tryng to return a attr html type.
>>> That's the content of the represent method
>>> dt_str = valor.strftime("%H:%M:%S %d/%m/%Y")
>>> return XML('%s' % (valor.strftime("%A").title(), 
>>> dt_str))
>>>
>>>
>>>

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


[web2py] Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Hi,
I think on last update the belongs stoped working.
I've a table that is defined like this:
db.define_table("regra_entrada",
Field("descricao", notnull=True, represent=nome, requires=[
IS_NOT_EMPTY(), IS_UPPER()]),
Field("data_inicial", "date", widget=SQLFORM.widgets.string.
widget, represent=campo_date_dia_semana,
  default=request.now.date() + datetime.timedelta(days=1
), notnull=True),
Field("data_final", "date", notnull=True, widget=SQLFORM.
widgets.string.widget,
  represent=campo_date_dia_semana),
# Definido as delimitações abaixo
Field("modo", "integer", widget=SQLFORM.widgets.radio.widget
, notnull=True,
  represent=lambda v, l: _dic_modo[v] if v is not None 
else None, requires=IS_IN_SET(_dic_modo)),
Field("notificacao_sms", "boolean", notnull=True, default=
True),
Field("notificacao_email", "boolean", notnull=True, default=
True),
Field("turnos", "list:integer", represent=lambda l, v: ", ".
join([db.turno(i).sigla for i in l]),
  requires=IS_IN_DB(db, db.turno, multiple=True, label=
db.turno._format)))

Then, it's populated like this:
>>> print db(db.regra_entrada.id > 0).select()
regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms,
regra_entrada.notificacao_email,regra_entrada.turnos
19,OUTRO TESTE,2015-03-25,2015-05-01,0,True,True,|2|3|1|

The problem is, i'm pretty sure that belongs should be working on this 
case, as i have already tested it on early versions. But now belongs not 
work, this is the outpout for belongs of field "turnos" with "3"(that is on 
the table, on the previous output):
>>> print db(db.regra_entrada.turnos.belongs([3])).select()
regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms,
regra_entrada.notificacao_email,regra_entrada.turnos



Maybe something was changed on the version i'm using? Or some specific 
change to the postgres DAL?


Web2py version: 2.9.12-stable+timestamp.2015.01.17.06.11.03
Rocket 1.2.6, Python 2.7.9
OS: Debian 8(wheezy)
Postgres: "PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by 
gcc-4.9.real (Debian 4.9.2-10) 4.9.2, 64-bit"


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


[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Looks like that the belongs function to the "list:" has changed to 
the "contains", that's correct?

Em sábado, 28 de março de 2015 12:43:56 UTC-3, Leonardo Pires Felix 
escreveu:
>
> Hi,
> I think on last update the belongs stoped working.
> I've a table that is defined like this:
> db.define_table("regra_entrada",
> Field("descricao", notnull=True, represent=nome, requires
> =[IS_NOT_EMPTY(), IS_UPPER()]),
> Field("data_inicial", "date", widget=SQLFORM.widgets.
> string.widget, represent=campo_date_dia_semana,
>   default=request.now.date() + datetime.timedelta(days
> =1), notnull=True),
> Field("data_final", "date", notnull=True, widget=SQLFORM.
> widgets.string.widget,
>   represent=campo_date_dia_semana),
> # Definido as delimitações abaixo
> Field("modo", "integer", widget=SQLFORM.widgets.radio.
> widget, notnull=True,
>   represent=lambda v, l: _dic_modo[v] if v is not None 
> else None, requires=IS_IN_SET(_dic_modo)),
> Field("notificacao_sms", "boolean", notnull=True, default=
> True),
> Field("notificacao_email", "boolean", notnull=True, 
> default=True),
> Field("turnos", "list:integer", represent=lambda l, v: ", 
> ".join([db.turno(i).sigla for i in l]),
>   requires=IS_IN_DB(db, db.turno, multiple=True, label
> =db.turno._format)))
>
> Then, it's populated like this:
> >>> print db(db.regra_entrada.id > 0).select()
> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
> regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms,
> regra_entrada.notificacao_email,regra_entrada.turnos
> 19,OUTRO TESTE,2015-03-25,2015-05-01,0,True,True,|2|3|1|
>
> The problem is, i'm pretty sure that belongs should be working on this 
> case, as i have already tested it on early versions. But now belongs not 
> work, this is the outpout for belongs of field "turnos" with "3"(that is on 
> the table, on the previous output):
> >>> print db(db.regra_entrada.turnos.belongs([3])).select()
> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
> regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms,
> regra_entrada.notificacao_email,regra_entrada.turnos
>
>
>
> Maybe something was changed on the version i'm using? Or some specific 
> change to the postgres DAL?
>
>
> Web2py version: 2.9.12-stable+timestamp.2015.01.17.06.11.03
> Rocket 1.2.6, Python 2.7.9
> OS: Debian 8(wheezy)
> Postgres: "PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by 
> gcc-4.9.real (Debian 4.9.2-10) 4.9.2, 64-bit"
>
>
>

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


[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Not working too on the version for testers, in this case using sqlite. 
Example:

db.define_table("business_day",
   Field("description", notnull=True),
   Field("week_days", "list:integer", notnull=True))

db.business_day.insert(description='first week january 2015', week_days=[3,4
])
1L
>>> print db(db.business_day.id>0).select()
business_day.id,business_day.description,business_day.week_days
1,first week january 2015,|3|4|

>>> db(db.business_day.week_days.belongs([3])).select()


>>> db(db.business_day.week_days.belongs([3]))._select()
"SELECT  business_day.id, business_day.description, business_day.week_days 
FROM business_day WHERE (business_day.week_days IN ('|3|'));"


Em sábado, 28 de março de 2015 13:27:28 UTC-3, Massimo Di Pierro escreveu:
>
> Can you please try the "for testers" version on the web site? Can you 
> provide a simpler example to reproduce the problem?
>
> On Saturday, 28 March 2015 10:43:56 UTC-5, Leonardo Pires Felix wrote:
>>
>> Hi,
>> I think on last update the belongs stoped working.
>> I've a table that is defined like this:
>> db.define_table("regra_entrada",
>> Field("descricao", notnull=True, represent=nome, requires
>> =[IS_NOT_EMPTY(), IS_UPPER()]),
>> Field("data_inicial", "date", widget=SQLFORM.widgets.
>> string.widget, represent=campo_date_dia_semana,
>>   default=request.now.date() + datetime.timedelta(
>> days=1), notnull=True),
>> Field("data_final", "date", notnull=True, widget=SQLFORM.
>> widgets.string.widget,
>>   represent=campo_date_dia_semana),
>> # Definido as delimitações abaixo
>> Field("modo", "integer", widget=SQLFORM.widgets.radio.
>> widget, notnull=True,
>>   represent=lambda v, l: _dic_modo[v] if v is not 
>> None else None, requires=IS_IN_SET(_dic_modo)),
>> Field("notificacao_sms", "boolean", notnull=True, default
>> =True),
>> Field("notificacao_email", "boolean", notnull=True, 
>> default=True),
>> Field("turnos", "list:integer", represent=lambda l, v: ", 
>> ".join([db.turno(i).sigla for i in l]),
>>   requires=IS_IN_DB(db, db.turno, multiple=True, 
>> label=db.turno._format)))
>>
>> Then, it's populated like this:
>> >>> print db(db.regra_entrada.id > 0).select()
>> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
>> regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms
>> ,regra_entrada.notificacao_email,regra_entrada.turnos
>> 19,OUTRO TESTE,2015-03-25,2015-05-01,0,True,True,|2|3|1|
>>
>> The problem is, i'm pretty sure that belongs should be working on this 
>> case, as i have already tested it on early versions. But now belongs not 
>> work, this is the outpout for belongs of field "turnos" with "3"(that is on 
>> the table, on the previous output):
>> >>> print db(db.regra_entrada.turnos.belongs([3])).select()
>> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
>> regra_entrada.data_final,regra_entrada.modo,regra_entrada.notificacao_sms
>> ,regra_entrada.notificacao_email,regra_entrada.turnos
>>
>>
>>
>> Maybe something was changed on the version i'm using? Or some specific 
>> change to the postgres DAL?
>>
>>
>> Web2py version: 2.9.12-stable+timestamp.2015.01.17.06.11.03
>> Rocket 1.2.6, Python 2.7.9
>> OS: Debian 8(wheezy)
>> Postgres: "PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by 
>> gcc-4.9.real (Debian 4.9.2-10) 4.9.2, 64-bit"
>>
>>
>>

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


[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Even on documentation has belongs checking if a value(or iterable obj) is 
in the field:
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs
"
belongs

The SQL IN operator is realized via the belongs method which returns true 
when the field value belongs to the specified set (list or tuples):

>>> for row in db(db.log.severity.belongs((1, 2))).select():
print row.event
port scan
xss injection



Em sábado, 28 de março de 2015 18:31:31 UTC-3, Anthony escreveu:
>
> If you want to see if a particular item is in the stored list, the correct 
> method has always been .contains(), not .belongs(). Using the later doesn't 
> really make sense in this context (.belongs() is for checking whether a 
> single value stored in a database field is in a list of values -- we are 
> doing the opposite here, checking whether a single value is in a list 
> stored in a database field).
>
> Anthony
>
> On Saturday, March 28, 2015 at 12:26:55 PM UTC-4, Leonardo Pires Felix 
> wrote:
>>
>> Looks like that the belongs function to the "list:" has changed to 
>> the "contains", that's correct?
>>
>> Em sábado, 28 de março de 2015 12:43:56 UTC-3, Leonardo Pires Felix 
>> escreveu:
>>>
>>> Hi,
>>> I think on last update the belongs stoped working.
>>> I've a table that is defined like this:
>>> db.define_table("regra_entrada",
>>> Field("descricao", notnull=True, represent=nome, 
>>> requires=[IS_NOT_EMPTY(), IS_UPPER()]),
>>> Field("data_inicial", "date", widget=SQLFORM.widgets.
>>> string.widget, represent=campo_date_dia_semana,
>>>   default=request.now.date() + datetime.timedelta(
>>> days=1), notnull=True),
>>> Field("data_final", "date", notnull=True, widget=SQLFORM
>>> .widgets.string.widget,
>>>   represent=campo_date_dia_semana),
>>> # Definido as delimitações abaixo
>>> Field("modo", "integer", widget=SQLFORM.widgets.radio.
>>> widget, notnull=True,
>>>   represent=lambda v, l: _dic_modo[v] if v is not 
>>> None else None, requires=IS_IN_SET(_dic_modo)),
>>> Field("notificacao_sms", "boolean", notnull=True, 
>>> default=True),
>>> Field("notificacao_email", "boolean", notnull=True, 
>>> default=True),
>>> Field("turnos", "list:integer", represent=lambda l, v: ", 
>>> ".join([db.turno(i).sigla for i in l]),
>>>   requires=IS_IN_DB(db, db.turno, multiple=True, 
>>> label=db.turno._format)))
>>>
>>> Then, it's populated like this:
>>> >>> print db(db.regra_entrada.id > 0).select()
>>> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
>>> regra_entrada.data_final,regra_entrada.modo,regra_entrada.
>>> notificacao_sms,regra_entrada.notificacao_email,regra_entrada.turnos
>>> 19,OUTRO TESTE,2015-03-25,2015-05-01,0,True,True,|2|3|1|
>>>
>>> The problem is, i'm pretty sure that belongs should be working on this 
>>> case, as i have already tested it on early versions. But now belongs not 
>>> work, this is the outpout for belongs of field "turnos" with "3"(that is on 
>>> the table, on the previous output):
>>> >>> print db(db.regra_entrada.turnos.belongs([3])).select()
>>> regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
>>> regra_entrada.data_final,regra_entrada.modo,regra_entrada.
>>> notificacao_sms,regra_entrada.notificacao_email,regra_entrada.turnos
>>>
>>>
>>>
>>> Maybe something was changed on the version i'm using? Or some specific 
>>> change to the postgres DAL?
>>>
>>>
>>> Web2py version: 2.9.12-stable+timestamp.2015.01.17.06.11.03
>>> Rocket 1.2.6, Python 2.7.9
>>> OS: Debian 8(wheezy)
>>> Postgres: "PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by 
>>> gcc-4.9.real (Debian 4.9.2-10) 4.9.2, 64-bit"
>>>
>>>
>>>

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


[web2py] Re: Belongs not working

2015-03-29 Thread Leonardo Pires Felix
I think i misunderstood then.

Em domingo, 29 de março de 2015 01:15:01 UTC-3, Anthony escreveu:
>
> Yes, but you are doing the opposite here. You are not checking whether a 
> field value belongs to a list - you are checking whether a list stored in a 
> field contains a particular value. The book section on the list:-type 
> fields specifically says to use .contains for this purpose. This is not a 
> job for .belongs. 
>
> Anthony

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


[web2py] put table._format as default for referenced fields

2015-04-25 Thread Leonardo Pires Felix
Hi, 
There is a better way to put the table format attribute in each referenced 
field that has not a label specified?
My application has now 183 tables so far, and puting one by one is kind of 
boring.

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


[web2py] Re: sub sub menu in newest version

2015-04-26 Thread Leonardo Pires Felix
Nested menus are not implemented in bootstrap 3.
What you could do is add this piece of code to your layout.html
< style>

  .dropdown-submenu{position:relative;}

.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0
 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 
6px;}

.dropdown-submenu:hover>.dropdown-menu{display:block;}

.dropdown-submenu>a:after{display:block;content:" 
";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px
 0 5px 5px;border-left-color:#cc;margin-top:5px;margin-right:-10px;}

.dropdown-submenu:hover>a:after{border-left-color:#ff;}

.dropdown-submenu.pull-left{float:none;}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px
 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 
6px;}

< /style>

as sugested by *HarryR7  *web2py github issues 


Em domingo, 26 de abril de 2015 08:18:53 UTC-3, 黄祥 escreveu:
>
> hi,
>
> i realize that web2py sub sub menu in newest version is not work as 
> expected (no error occured but the result is not expected).
> *models/menu.py*
> response.menu = [
> (T('Menu'), False, URL('default', 'index'), [
> (T('Sub Menu 1'), False, URL('default', 'index'), [
> (T('Sub Menu 2'), False, URL('default', 'index'), []),
> ]),
> ]), 
> ]
>
> *result in html browser*
> 
> 
> Sub Menu 1
> 
> 
> Sub Menu 2
> 
> 
> 
> 
>
> how can i have the sub sub menu in web2py newest version? the previous 
> version (bootstrap 2) is worked as expected
>
> thanks and best regards,
> stifan
>

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


[web2py] Solve enconding on diferent server

2015-04-30 Thread Leonardo Pires Felix
Hi everyone.
i have a server that used for all my applications.
I can save any word on sqlform, "João", "josé", any word with accent.

But one of my clients needed that the server would be hosted on their 
depedencies. So i coppied the folder of my application, and made a dump of 
database.

Downloaded web2py on the client machine, and installed the application 
depedencies and restored database. The problem is if any accent letter is 
on the request. It gives the 'ascii' codec can't decode byte 0xc3 in 
position 215: ordinal not in range(128)

Any help in what may solve my problem? The database(original, and client) 
are in utf8, as both locales of the linux distribuitions is pt_br.UTF-8.

Maybe is a problem of change the distribution? On my server is debian 7, 
and on the client is one distribution called "Linux educacional" that is 
based on Ubuntu 11.

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


[web2py] Re: Solve enconding on diferent server

2015-05-05 Thread Leonardo Pires Felix
I can read the accents letters that from the database and they display 
normal.

But if i try to update or insert letter with accent it gives that 
unicodeerror

Em segunda-feira, 4 de maio de 2015 12:56:36 UTC-3, Tom Stratton escreveu:
>
> Hi -
>
> I've had several unicode issues pop up with postgres and pydal in the last 
> couple of weeks - it may be a version issue.
>
> What versions of web2py and pydal are you using, what database adapter, 
> and what - specifically - is giving you the crash?
>
> Is the problem when you try to read from the db or only when you write to 
> it? What is the stack track?
>
> The more info you provide the more likely you are to get help ;-)
>
> Tom
>

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


[web2py] Re: Solve enconding on diferent server

2015-05-05 Thread Leonardo Pires Felix
I think that the problem was that...

I've installed psycopg2 and it dependencies. And worked as expected.

pg8000 has limitation/bug about this?

Em quinta-feira, 30 de abril de 2015 22:39:59 UTC-3, Leonardo Pires Felix 
escreveu:
>
> Hi everyone.
> i have a server that used for all my applications.
> I can save any word on sqlform, "João", "josé", any word with accent.
>
> But one of my clients needed that the server would be hosted on their 
> dependencies. So i copied the folder of my application, and made a dump of 
> database.
>
> Downloaded web2py on the client machine, and installed the application 
> depedencies and restored database. The problem is if any accent letter is 
> on the request. It gives the 'ascii' codec can't decode byte 0xc3 in 
> position 215: ordinal not in range(128)
>
> Any help in what may solve my problem? The database(original, and client) 
> are in utf8, as both locales of the linux distribuitions is pt_br.UTF-8.
>
> Maybe is a problem of change the distribution? On my server is debian 7, 
> and on the client is one distribution called "Linux educacional" that is 
> based on Ubuntu 11.
>

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


[web2py] Re: allow multiple extensions on upload

2015-07-07 Thread Leonardo Pires Felix
The validator IS_UPLOAD_FILENAME does what you want. Just add the regex 
that check if the extension is the one you want.

requires = IS_UPLOAD_FILENAME(filename='^README$', extension='^(py|java|c)$', 
case=0)



Em terça-feira, 7 de julho de 2015 18:40:55 UTC-3, reddyreddy escreveu:
>
> Hello,
>
> I want to allow upload field to be as .c or .java or .py.
> I have seen the book that there is a way for uploading images with 
> different extensions.
> Can anyone please let me know how to do it for files.
>
> Thanks in advance.
>

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


[web2py] Re: ascii codec can't decode byte

2015-07-07 Thread Leonardo Pires Felix
Use psycopg2 as database driver, just install it and restart your 
application.

pg8000 has a problem with coding.

Em terça-feira, 7 de julho de 2015 18:40:55 UTC-3, icodk escreveu:
>
> I have a small web2py site that works fine when runs on a Windows 7 
> machine.
> I move it to a linux machine,and everything worked fine until I try to 
> save some text to a pg database  that includes letters like: æØÅ
>
> I can insert that type of letters in the database (using pgAdmin3 or 
> commandline ) and even see it in a browser when web2py read it from the 
> database but when try to save it from the browser I get the  *'exceptions.UnicodeDecodeError'>** 'ascii' codec can't decode byte 0xc3 
> in position 248: ordinal not in range(128)*
> What am I doing wrong, Or better yet: How can I solve it?
>
>

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


[web2py] Re: JSON and url vars

2015-07-07 Thread Leonardo Pires Felix
This is not a recomended approach. Sending such variables on URL you may 
run out of space, see here . And 
those variables will be cached on user browser, giving space for security 
breaches. And exposing those variables to the user you may run with some 
unexpected behaviours

Em terça-feira, 7 de julho de 2015 13:05:44 UTC-3, Carla Raquel escreveu:
>
> I'm passing a few variables from the controller(including one of them a 
> list) to the view and I have a link that is built using those 
> variables.Below is the controller function:
>
> def indexResumo():
> meses = 
> {'Janeiro':1,'Fevereiro':2,'Março':3,'Abril':4,'Maio':5,'Junho':6,'Julho':7,'Agosto':8,'Setembro':9,'Outubro':10,'Novembro':11,'Dezembro':12}
> newlist=[]
> year =request.now.year
> name = session.auth.user.first_name + ' ' + session.auth.user.last_name
> month = (list(meses.keys())[list(meses.values()).index(request.now.month 
> - 1)])
> query = (db.auth_user.Supervisor == session.auth.user.id)
> colaboradores = 
> db(query).select(db.auth_user.first_name,db.auth_user.last_name)
> for x in colaboradores:
> newlist.append(x.first_name + ' ' + x.last_name)
>
> return locals()
>
>
> And here is part of the view "indexResumo" that matters:
>
>  href="{{=URL('default','resumoMensalTMN',vars={'nome':name,'mes':month,'ano':year,'colaboradores':newlist})}}">
>
>  href="{{=URL('default','resumoMensalLocal',vars={'nome':name,'mes':month,'ano':year,'colaboradores':newlist})}}">
>
>
> When the above link loads, I have a javascript function that reads each of 
> the variables passed:
>
> getUrlVars()["name_of_the_var"];
>
>
> My question is,what would be better: reading the variables this way, or 
> move the code in the function "indexResumo" to both functions 
> "resumoMensalTMN" and "resumoMensalLocal",have no variables sent in the 
> url, and read those via json on my view? I hope I made any sense here.
>

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


[web2py] Widget on read operations

2015-07-12 Thread Leonardo Pires Felix
Hi, there is a way to implement widgets for read operations?
I have a field that hold a hex color, so on grid, it would show the color, 
not the hex value (#FF).

I can use the represent to make what i want, but if i use a export like 
csv, on the content will have the html i used to give the color

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


[web2py] btn_group on smartgrid

2015-07-18 Thread Leonardo Pires Felix
There is how implement the btn_group (see bootstrap btn-group 
) with the linked tables on 
smartgrid? I've a couple of linked tables,the grid is to big because of the 
linked tables to see details of the row.
I think a btn-group will make more good looking for the user.

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


[web2py] How accept latin letters on args

2015-08-29 Thread Leonardo Pires Felix
Hi guys,

I'm doing a little CMS for my application,

My application can have some posts, so every post should be in a url like 
this /application/cms/post/{arg0:postid}/{arg1:the title of the post).
The title of the post i'll not use it, it's just for a more friendly url. 
But if the title has non utf-8 letters like ç or ã web2py raises a invalid 
request.

There is a way to accept those letters on args?

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


[web2py] Strange error on scheduler

2015-09-20 Thread Leonardo Pires Felix
starting scheduler from widget for "gie"...
Currently running 1 scheduler processes
Processes started
Traceback (most recent call last):
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/shell.py", 
line 271, in run
exec(python_code, _env)
  File "", line 1, in 
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/scheduler.py", 
line 725, in loop
task = self.wrapped_pop_task()
  File "/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/scheduler.py", 
line 775, in wrapped_pop_task
db.commit()  # another nifty db.commit() only for Mysql
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/packages/dal/pydal/base.py"
, line 934, in commit
self._adapter.commit()
  File 
"/home/leonardo/PycharmProjects/lpfx_gie/web2py/gluon/packages/dal/pydal/adapters/base.py"
, line 1328, in commit
return self.connection.commit()
OperationalError: Erro de SSL: decryption failed or bad record mac

Someone already had this error? What may be causing it?

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


[web2py] Re: additional software to run postgreSQL/postGIS on web2py

2015-11-15 Thread Leonardo Pires Felix
In the case of PostgreSQL, you only need the PostgreSQL database installed 
and running, as described in Detailed installation guides[PostgreSQL] 
. 

Em domingo, 15 de novembro de 2015 08:57:34 UTC-2, Pierre escreveu:
>
> Hi all,
>
> It is unclear in the doc what's already included in web2py or what 
> additional software is necessary to use postgreSQL/postGIS ?
> I tried to connect like this :
>
> >>> db= DAL("postgres://:@localhost/test") 
>
> Traceback (most recent call last): 
>
> File "", line 1, in  
>
> File "/opt/web2py/gluon/packages/dal/pydal/base.py", line 174, in __call__ 
>
> obj = super(MetaDAL, cls).__call__(*args, **kwargs) 
>
> File "/opt/web2py/gluon/packages/dal/pydal/base.py", line 459, in __init__ 
>
> raise RuntimeError("Failure to connect, tried %d times:\n%s" % (attempts, 
> tb)) 
>
> RuntimeError: Failure to connect, tried 5 times: 
>
> Traceback (most recent call last): 
>
> File "/opt/web2py/gluon/packages/dal/pydal/base.py", line 437, in __init__ 
>
> self._adapter = ADAPTERS[self._dbname](**kwargs) 
>
> File "/opt/web2py/gluon/packages/dal/pydal/adapters/base.py", line 57, in 
> __call__ 
>
> obj = super(AdapterMeta, cls).__call__(*args, **kwargs) 
>
> File "/opt/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 153, in __init__ 
>
> self.reconnect() 
>
> File "/opt/web2py/gluon/packages/dal/pydal/connection.py", line 104, in 
> reconnect 
>
> self.connection = f() 
>
> File "/opt/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 
> 150, in connector 
>
> return self.driver.connect(**driver_args) 
>
> File "/opt/web2py/gluon/contrib/pg8000/__init__.py", line 336, in connect 
>
> user, host, unix_sock, port, database, password, ssl) 
>
> File "/opt/web2py/gluon/contrib/pg8000/core.py", line 969, in __init__ 
>
> raise InterfaceError("communication error", exc_info()[1]) 
>
> InterfaceError: ('communication error', error(111, 'Connection refused')) 
>
> so I guess web2py is missing some additional element:
>
> what additional packages, adaptersetc  are necessary to make this work 
> ?
> do I have to install all these ?:
> http://postgis.net/docs/manual-2.0/postgis_installation.html#idp39560176
>

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