[web2py] cannot reference db.auth_group in model ?

2020-02-12 Thread António Ramos
Hello all i have a problem relating a record to auth_group records creating in admin a new record in table menus, referencing one or more auth_group record results in a record with None in visibleTo field. Why ? [image: image.png] db.define_table("apps", Field("title"), Field("icon"),

[web2py] py4web Form customization

2020-02-12 Thread Alex Beskopilny
is that possible? similar to the web2py {{=form.custom.begin}}Name: {{=form.custom.widget.name}}{{=form.custom.submit}}{{=form.custom.end}} form.element('input[name=name]')['_id']='myid' form.element('input[name=name]')['_class']='myclass' Thanks Alex -- Resources: -

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Christian Varas
I had an issue with line breaks too, I remove lie breaks like this with python 3.7 some_string = some_string.replace(“\n”, ””).replace(“\r”, ””) XML(some_string, sanitize=True) Cheers Chris El El mié, 12 de feb. de 2020 a la(s) 04:37, Clemens < clemens.odend...@claret-clover.de> escribió: >

[web2py] Re: cannot reference db.auth_group in model ?

2020-02-12 Thread António Ramos
correct model db.define_table("apps", Field("title"), Field("icon"), Field("bg"), Field("url"), format='%(title)s' ) db.define_table('menus', Field("visibleTo",'reference auth_group'), Field("app",'reference apps'),

[web2py] Re: cannot reference db.auth_group in model ?

2020-02-12 Thread António Ramos
any help ? thank you Em qua., 12 de fev. de 2020 às 11:31, António Ramos escreveu: > correct model > db.define_table("apps", > Field("title"), > Field("icon"), > Field("bg"), > Field("url"), > format='%(title)s' > ) > db.define_table('menus', >

[web2py] Re: cannot reference db.auth_group in model ?

2020-02-12 Thread António Ramos
problem solved. Forgot to add "*list:*reference auth_group" regards António Em qua., 12 de fev. de 2020 às 11:31, António Ramos escreveu: > any help ? > thank you > > Em qua., 12 de fev. de 2020 às 11:31, António Ramos > escreveu: > >> correct model >> db.define_table("apps", >>

[web2py] special chars in view, utf8 issue ?!

2020-02-12 Thread António Ramos
Hello i cant understand how to solve this issue. I have a record with portuguese characters "Ações de cada um" that passing it to the view results in a different value. How do i understand it to solve it ? [image: image.png] This is the result in my view My layout has and my view is just

[web2py] Re: special chars in view, utf8 issue ?!

2020-02-12 Thread Clemens
Hello Ramos, since I can't see your screenshot, I have to guess. But in German we also our special characters and I encode these by the following procedure: import re > import sys > > def convert_special_chars(label): > if sys.version_info[0]==2: # python 2.x > label =

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Clemens
Hi Chris, thanks a lot for your help! But the problem still exists even replacing my str_replace routine by str.replace() as proposed by you. Yes, I had the same problem with line breaks crashing the view. And replacing the line breaks by fixed it. But switching form python 2.7 to 3.6 raises

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Clemens
Hello Chris, thanks for your answer! But just kicking out all line breaks is a little harsh, since in my case the description is mostly a few lines long with 2 or 3 paragraphs. And I had the problem already solved by this procedure and the call as described in my question: def

Re: [web2py] webp2y XML helper sanitize line breaks under python3.6

2020-02-12 Thread Christian Varas
Hi Clemens, Replace can handle big text it does not matter if is 1 - 1000 lines or more, It will replace all the occurrences in the text, also is faster. chaining "replace" is more faster than other methods. description = his_item.description.replace("\n","").replace("\r","

Re: [web2py] Re: Looking for web2py developer for Italian small company

2020-02-12 Thread Vlad
I've used web2py happily until today, but seems need to switch to py4web :) I've never looked into py4web; just saw msgs going back and forth about it. What's the best way to start? Any tutorials? Is there a book similar to the one on web2py? What's the home page (assuming it's separate from

Re: [web2py] Re: Looking for web2py developer for Italian small company

2020-02-12 Thread Dave S
On Wednesday, February 12, 2020 at 12:02:10 PM UTC-8, Vlad wrote: > > I've used web2py happily until today, but seems need to switch to py4web :) > > I've never looked into py4web; just saw msgs going back and forth about > it. > > What's the best way to start? Any tutorials? Is there a book