[web2py] Re: New table fields don't show
SOLVED. I'm terribly sorry. It was my mistake. The reason for all these problems was that I had made a "lazy" backup of the old model file in a sub-folder, and it was also being interpreted, at: models/_versions/tab_9may2018.py I just found this looking at administrative interface. It's a silly mistake, and I hope, at least, my bad example will help other absent-minded programmers. Thank you for your help Luis On Thursday, 17 May 2018 16:00:30 UTC+1, Anthony wrote: > > Have you compiled the app? If not, not sure what could be going on. Feel > free to pack and attach a minimal app that reproduces the problem (will > have to be with SQLite). > > Anthony > > On Wednesday, May 16, 2018 at 10:54:27 AM UTC-4, Luís Guilherme F wrote: >> >> 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 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/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: >>>> >>>> db.define_table('mercado', >>>> Field('cod_m', type='integer'), >>>> Field('nome',type='string') >>>> migrate=False) >>>> >>>> Now: >>>> >>>> db.define_table('mercado', >>>> Field('cod_m', type='integer'), >>>> Field('nome',type='string'), >>>> Field('regiao', type='integer'), >>>> Field('tipo',type='integer'), >>>> fake_migrate=True) >>>> >>>> Best regards, >>>> Luís >>>> >>> -- 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: New table fields don't show
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 107, in raise_mysql_exception raise errorclass(errno, errval) ProgrammingError: (1146, u"Table 'cotsima.mercado' doesn't exist") Then I included the db.define_table('mercado', ... again, in db.py After that I get no errors clicking on db.mercado at appadmin, but still have only two fields at Insert New Record form. On Wednesday, 16 May 2018 16:24:02 UTC+1, Luís Guilherme F wrote: > > 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 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 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/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: >>>> >>>> db.define_table('mercado', >>>> Field('cod_m', type='integer'), >>>> Field('nome',type='string') >>>> migrate=False) >>>> >>>> Now: >>>> >>>> db.define_table('mercado', >>>> Field('cod_m', type='integer'), >>>> Field('nome',type='string'), >>>> Field('regiao', type='integer'), >>>> Field('tipo',type='integer'), >>>> fake_migrate=True) >>>> >>>> Best regards, >>>> Luís >>>> >>> -- 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: New table fields don't show
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 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 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/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: >>> >>> db.define_table('mercado', >>> Field('cod_m', type='integer'), >>> Field('nome',type='string') >>> migrate=False) >>> >>> Now: >>> >>> db.define_table('mercado', >>> Field('cod_m', type='integer'), >>> Field('nome',type='string'), >>> Field('regiao', type='integer'), >>> Field('tipo',type='integer'), >>> fake_migrate=True) >>> >>> Best regards, >>> Luís >>> >> -- 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: New table fields don't show
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 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/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: >> >> db.define_table('mercado', >> Field('cod_m', type='integer'), >> Field('nome',type='string') >> migrate=False) >> >> Now: >> >> db.define_table('mercado', >> Field('cod_m', type='integer'), >> Field('nome',type='string'), >> Field('regiao', type='integer'), >> Field('tipo',type='integer'), >> fake_migrate=True) >> >> Best regards, >> Luís >> > -- 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] New table fields don't show
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: db.define_table('mercado', Field('cod_m', type='integer'), Field('nome',type='string') migrate=False) Now: db.define_table('mercado', Field('cod_m', type='integer'), Field('nome',type='string'), Field('regiao', type='integer'), Field('tipo',type='integer'), fake_migrate=True) Best regards, Luís -- 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: TypeError: getattr(): attribute name must be string
It happened on any request. Thanks for your feedback. SOLVED: I noticed that the app runs without errors when it's called from the admin page (https). So I found the only relevant difference between Apache's http and https configuration: *WSGIDaemonProcess web2py* WSGIProcessGroup web2py WSGIScriptAlias / /opt/web2py/wsgihandler.py (...) WSGIProcessGroup web2py WSGIScriptAlias / /opt/web2py/wsgihandler.py SOLUTION: *WSGIDaemonProcess web2py user=www-data group=www-data* WSGIProcessGroup web2py WSGIScriptAlias / /opt/web2py/wsgihandler.py As far as I remember, web2py's configuration used to be just like I showed you here. I just confirmed that, on the (very old) web2py 2.3.2 setup script. Mine is a very old web-server, so was this apache conf. QUESTION: After upgrading web2py to a newer version, should I always check the setup script for any changes to Apache conf? At web2py.com installation instructions only tells you to unzip after download. Great framework, though. Luís On Friday, 22 December 2017 12:53:48 UTC, Luís Guilherme F wrote: > > Hello, > I'm getting this error on a server with Apache 2.2 / Ubuntu 12.04, which > doesn't happen on a box with Apache 2.4 / Ubuntu 16.04 (both now with > web2py 2.16.1): > > Traceback (most recent call last): > File "/opt/web2py/gluon/main.py", line 434, in wsgibase > session.connect(request, response) > File "/opt/web2py/gluon/globals.py", line 1000, in connect > session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) > File "/opt/web2py/gluon/storage.py", line 52, in > __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self) > TypeError: getattr(): attribute name must be string > > (...) > File /opt/web2py/gluon/storage.py in at line 56 code arguments > variables > Function argument list > (self=) > > Version > 2.16.1-stable+timestamp.2017.11.14.05.54.25 > (Running on Apache/2.2.22 (Ubuntu), Python 2.7.3) > > I've updated Web2py from 2.14.6 to 2.16.1 but still get the error. > First overwriting the previous version, and now in a new folder. > > I'm trying to solve this for a few days now. > This app should be deployed for production on this Apache 2.2 server, and > I'm stuck with these errors. > > Any help would be most welcome > Luís > -- 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] TypeError: getattr(): attribute name must be string
Hello, I'm getting this error on a server with Apache 2.2 / Ubuntu 12.04, which doesn't happen on a box with Apache 2.4 / Ubuntu 16.04 (both now with web2py 2.16.1): Traceback (most recent call last): File "/opt/web2py/gluon/main.py", line 434, in wsgibase session.connect(request, response) File "/opt/web2py/gluon/globals.py", line 1000, in connect session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) File "/opt/web2py/gluon/storage.py", line 52, in __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self) TypeError: getattr(): attribute name must be string (...) File /opt/web2py/gluon/storage.py in at line 56 code arguments variables Function argument list (self=) Version 2.16.1-stable+timestamp.2017.11.14.05.54.25 (Running on Apache/2.2.22 (Ubuntu), Python 2.7.3) I've updated Web2py from 2.14.6 to 2.16.1 but still get the error. First overwriting the previous version, and now in a new folder. I'm trying to solve this for a few days now. This app should be deployed for production on this Apache 2.2 server, and I'm stuck with these errors. Any help would be most welcome Luís -- 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.