[web2py] Differnt represent in SQLFORM.grid and in the view

2018-05-16 Thread Martin Weissenboeck
​I am using* db.mytable.myfield.represent=function_to_represent* in the grid. After clicking the "view" button ​I want to see *myfield *in another representation. Is it possible to change *db.mytable.myfield.represent* only for the view? Regards, Martin -- Resources: - http://web2py.com -

Re: [web2py] Re: Differnt represent in SQLFORM.grid and in the view

2018-05-16 Thread Martin Weissenboeck
nice idea - thank you! 2018-05-16 10:11 GMT+02:00 黄祥 : > think you can use condition to check the request.args value then assign > the represent on it, before defining SQLFORM.grid > *e.g.* > if 'view' in request.args: > db.mytable.myfield.represent =

[web2py] Re: Differnt represent in SQLFORM.grid and in the view

2018-05-16 Thread 黄祥
think you can use condition to check the request.args value then assign the represent on it, before defining SQLFORM.grid *e.g.* if 'view' in request.args: db.mytable.myfield.represent = function_to_represent grid = SQLFORM.grid(...) best regards, stifan -- Resources: - http://web2py.com -

[web2py] Re: web2py 2.16.1 is OUT

2018-05-16 Thread 黄祥
test in web2py source 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Rocket 1.2.6, Python 3.6.2) Traceback (most recent call last): File "/Users/sugizo/python/web2py/gluon/custom_import.py", line 77, in custom_importer return NATIVE_IMPORTER(oname, globals, locals, fromlist,

[web2py] TABLE FOR LIST:REFERENCE

2018-05-16 Thread Ayron Rangel
Guys, How can I display the list:reference like a table? Ex.: I have this in db.py: "Field('product', 'list:reference products', notnull=True, label='Products')" in my view appears, like this:

Re: [web2py] TABLE FOR LIST:REFERENCE

2018-05-16 Thread Ayron Rangel
I Just used {{=form}} um mundo view!! Could you know to do that in custom?? Em qua, 16 de mai de 2018 12:19, António Ramos escreveu: > What code are u using in your view to display the record? > > 2018-05-16 15:17 GMT+01:00 Ayron Rangel : > >>

Re: [web2py] TABLE FOR LIST:REFERENCE

2018-05-16 Thread António Ramos
What code are u using in your view to display the record? 2018-05-16 15:17 GMT+01:00 Ayron Rangel : > Guys, > > How can I display the list:reference like a table? > > Ex.: I have this in db.py: "Field('product', 'list:reference products', > notnull=True,

[web2py] Re: New table fields don't show

2018-05-16 Thread Luís Guilherme F
Here's the output of the Query db.mercado.id>0 : mercado.id mercado.cod_m mercado.nome 136 5 Beira Litoral 137 7 Alentejo 138 8 Entre Douro e... 139 14 Centro (Aveir... 140 15 Norte (Viseu) 141 16 Oeste Luís On Wednesday, 16 May 2018 15:54:27 UTC+1, Luís Guilherme F wrote: > > Anthony, > What I

[web2py] Re: python2 and python3 in 1 machine

2018-05-16 Thread Antonio Salazar
You just install them both, as your instructions say. If you want to start wen2py in python2, just execute it with python: python web2py.py If you want to start web2py in Python 3, execute it with python3: python3 web2py.py This is how I do it in Linux, but I'm almost sure MacOS does it the

[web2py] Re: New table fields don't show

2018-05-16 Thread Luís Guilherme F
Anthony, What I see are only the two first columns (cod_m, nome), on a table query on appadmin (database administration). The two new columns (regiao, tipo) are not shown. Thank you Luís On Wednesday, 16 May 2018 14:51:41 UTC+1, Anthony wrote: > > It's not quite clear what the current problem

[web2py] Re: sending html emails.... bug ...

2018-05-16 Thread António Ramos
In fact its not an issue with images , any help? regards 2018-05-16 17:14 GMT+01:00 António Ramos : > Hello i´m sending html emails but some clients for example google have an > issue with images > > Google is showing this code for the original html email... > >

[web2py] sending html emails.... bug ...

2018-05-16 Thread António Ramos
Hello i´m sending html emails but some clients for example google have an issue with images Google is showing this code for the original html email... https://www.iol.pt; target=*3D*"_blank"> instead of https://www.iol.pt; target="_blank"> what could be the issue with *3D ???* regards

[web2py] Re: New table fields don't show

2018-05-16 Thread Anthony
It's not quite clear what the current problem is. Are you getting an error? What do you see, and what are you expecting instead? On Wednesday, May 16, 2018 at 9:20:23 AM UTC-4, Luís Guilherme F wrote: > > Hello, > I had a table with two fields. My app was fine. > Then I added two more but

[web2py] New table fields don't show

2018-05-16 Thread Luís Guilherme F
Hello, I had a table with two fields. My app was fine. Then I added two more but web2py/appadmin doesn't show them. I used mysql tools to change it. Then I corrected my models/db.py, and ONLY then I ran appadmin. I've tried migrate=False (and True) and fake_migrate=True. Original table:

[web2py] Re: New table fields don't show

2018-05-16 Thread Luís Guilherme F
Now I've dropped the table and deleted the "define_table" command in models/db.py. Nevertheless, table 'mercado' is still listed in appadmin console's table list. But when I click on it I get an error with a long Traceback which ends with: File "/opt/web2py/gluon/contrib/pymysql/err.py", line

[web2py] Re: sending html emails.... bug ...

2018-05-16 Thread António Ramos
Just found out that 3D is inserted all over the html tags in another emails i get. So this should be normal. So my problems is with base 64 images... google does not display them correctly. Any tweek in mail.send ??? 2018-05-16 17:16 GMT+01:00 António Ramos : > In fact

[web2py] IS_LENGTH does not work with "list:string"

2018-05-16 Thread Martin Weissenboeck
That is ok: form = SQLFORM.factory( Field("auswahl", "string", length=15, requires=IS_LENGTH(15,3)), ) This does not work: form = SQLFORM.factory( Field("auswahl", "list:string", length=15, requires=IS_LENGTH(15,3)), ) ​Regards, Martin​ -- Resources: -

Re: [web2py] IS_LENGTH does not work with "list:string"

2018-05-16 Thread Martin Weissenboeck
I understand that there is no DEFAULT VALIDATOR for 'list:string', but it seems that is not possible to use IS_LENGTH at all. Ok, I have used onvalidation. Another problem: form = SQLFORM.factory( Field("auswahl", "list:string"), ) If there is only one item in "auswahl" then the

Re: [web2py] IS_LENGTH does not work with "list:string"

2018-05-16 Thread Kiran Subbaraman
According to the documentation (http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types), `list:string` does not have a validator. Maybe you can create your own? On 16-05-2018 22:26, Martin Weissenboeck wrote: That is ok: form = SQLFORM.factory(        

Re: [web2py] IS_LENGTH does not work with "list:string"

2018-05-16 Thread Kiran Subbaraman
Yikes, I meant "default validators". My mistake. On 16-05-2018 22:43, Kiran Subbaraman wrote: According to the documentation (http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types), `list:string` does not have a validator. Maybe you can create your own?

Re: [web2py] New table fields don't show

2018-05-16 Thread Carlos Correia
Às 14:20 de 16-05-2018, Luís Guilherme F escreveu: > Hello, > I had a table with two fields. My app was fine. > Then I added two more but web2py/appadmin doesn't show them. > I used mysql tools to change it. > Then I corrected my models/db.py, and ONLY then I ran appadmin. > I've tried