[web2py] Re: 1.94.5 is OUT
The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo
[web2py] Re: 1.94.5 is OUT
Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that says Version 1.94.5 (2011-03-18 20:24:56) so just a mismatch issue (or not letting go of the initial read value?). If no one else spot the problem, then we can say the problem is on my end and that I should probably reboot or something Thanks Massimo! On Mar 19, 2:55 am, kenji4569 hos...@s-cubism.jp wrote: The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo
Re: [web2py] Re: Best way to return all users who have a specific role?
Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried this with alternative syntax: auth.add_permission(1, 'read', db.auth_user) 2 and tried other tables: auth.add_permission(1, 'read', db.post) 3 but still no entries in auth_permission. Any ideas? On 18 March 2011 20:08, Massimo Di Pierro massimo.dipie...@gmail.comwrote: If you have given explicit permission to the group: group_id=auth.add_group('Super Admin') auth.add_permission(group_id, 'read', db.mytable) then you can do: for row in db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL): print row in the case being discussed mytable is auth_user On Mar 18, 2:38 pm, Tom Atkins minkto...@gmail.com wrote: Thank you - yes the double hit on the database was what made it seem inelegant to me. Your joined query works fine and I can work with the return data. Any further improvements gratefully received! Hoping Massimo has an undocumented super 1 liner! ;-)
Re: [web2py] Re: Newbie questions
On Wed, Mar 16, 2011 at 12:46 PM, Anthony abasta...@gmail.com wrote: On Wednesday, March 16, 2011 5:29:09 AM UTC-4, Nick Rosencrantz wrote: Hi I just deployed my first attempt to try web2py with google app engine (http://matochsovklockan.appspot.com) Basically it works while a few links return invalid request eg http://matochsovklockan.appspot.com/examples/default/index That URL is looking for the 'examples' app that comes with web2py. Note, if you used the default app.yaml file that comes with web2py for GAE deployment, the 'examples' and 'admin' apps won't be deployed on GAE -- they are excluded in the skip_files section of app.yaml. If you want to deploy the 'examples' app, you'll have to edit app.yaml accordingly. This is explained in the Google App Engine section of chapter 11 of the book (I'd provide a link, but the online book happens to be down right now). Anthony Thanks Anthony, now I understand what's going on with my start. I think web2py seems an exciting and powerful approach to web development. /Nick Rosencrantz
[web2py] my newbie questions have been ignored
I have written to this list with my problems * http://groups.google.com/group/web2py/browse_thread/thread/c40a1ddcbcfe99ea# * http://groups.google.com/group/web2py/browse_thread/thread/692df385b5d3308b# and in 24 or so hours there has been no response. I saw the recent reddit threads. I watched the vidoes. I got interested and now I feel forced to look elsewhere. Rapid free support is available for the web frameworks which are objectively inferior to web2py. This may be why web2py doesnt have as much popularity as it deserves: people come, try, fail, dont get support and then are forced to find greener pastures.
Re: [web2py] my newbie questions have been ignored
Sorry to hear your questions didn't get answered more quickly. I'm a relative newbie here and have always been impressed with the speed, helpfulness and friendliness of the group. Don't give up yet! With regard to the issues you're having with database commits I too am having problems in the last 24 hours with inserts and updates to SQLlite database from shell using trunk. I haven't had time to troubleshoot yet but am wondering if this is just a problem with the latest 1.94.x releases? I'm having a look at this right now and will get report back with what I find. On 19 March 2011 12:19, Terrence Brannon scheme...@gmail.com wrote: I have written to this list with my problems - http://groups.google.com/group/web2py/browse_thread/thread/c40a1ddcbcfe99ea# - http://groups.google.com/group/web2py/browse_thread/thread/692df385b5d3308b# and in 24 or so hours there has been no response. I saw the recent reddit threads. I watched the vidoes. I got interested and now I feel forced to look elsewhere. Rapid free support is available for the web frameworks which are objectively inferior to web2py. This may be why web2py doesnt have as much popularity as it deserves: people come, try, fail, dont get support and then are forced to find greener pastures.
[web2py] Re: why is my database zero-length after commiting a record
Do you have another instance of web2py running in addition to the shell instance? If you do, then the sqllite db will be locked and the inserts will fail. Try stopping all other instances of web2py.
Re: [web2py] Re: Best way to return all users who have a specific role?
Oops - my mistake - I was using Navicat to look at my sqllite database and had left it open. hence sqllite db was locked. On 19 March 2011 10:41, Tom Atkins minkto...@gmail.com wrote: Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried this with alternative syntax: auth.add_permission(1, 'read', db.auth_user) 2 and tried other tables: auth.add_permission(1, 'read', db.post) 3 but still no entries in auth_permission. Any ideas? On 18 March 2011 20:08, Massimo Di Pierro massimo.dipie...@gmail.comwrote: If you have given explicit permission to the group: group_id=auth.add_group('Super Admin') auth.add_permission(group_id, 'read', db.mytable) then you can do: for row in db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL): print row in the case being discussed mytable is auth_user On Mar 18, 2:38 pm, Tom Atkins minkto...@gmail.com wrote: Thank you - yes the double hit on the database was what made it seem inelegant to me. Your joined query works fine and I can work with the return data. Any further improvements gratefully received! Hoping Massimo has an undocumented super 1 liner! ;-)
Re: [web2py] Re: Best way to return all users who have a specific role?
Hmm - I spoke too soon. Database changes work OK from controllers but not from shell... On 19 March 2011 13:03, Tom Atkins minkto...@gmail.com wrote: Oops - my mistake - I was using Navicat to look at my sqllite database and had left it open. hence sqllite db was locked. On 19 March 2011 10:41, Tom Atkins minkto...@gmail.com wrote: Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried this with alternative syntax: auth.add_permission(1, 'read', db.auth_user) 2 and tried other tables: auth.add_permission(1, 'read', db.post) 3 but still no entries in auth_permission. Any ideas? On 18 March 2011 20:08, Massimo Di Pierro massimo.dipie...@gmail.comwrote: If you have given explicit permission to the group: group_id=auth.add_group('Super Admin') auth.add_permission(group_id, 'read', db.mytable) then you can do: for row in db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL): print row in the case being discussed mytable is auth_user On Mar 18, 2:38 pm, Tom Atkins minkto...@gmail.com wrote: Thank you - yes the double hit on the database was what made it seem inelegant to me. Your joined query works fine and I can work with the return data. Any further improvements gratefully received! Hoping Massimo has an undocumented super 1 liner! ;-)
[web2py] Re: non redirection when authentication fails
Hi, a workaround for this (and I like it) is: auth = Auth(globals(),db, request.controller) With this I redirect to the login page for the correct controller when authentication fails. Regards, Joaquin. On Tue, Mar 15, 2011 at 12:15 PM, Joaquin Orbe joaquino...@gmail.com wrote: Hi All, I have two kind of users in my application: admins and users. Each of them has different index function which I've decored, that's why I get these URLs when trying to login: * admins login through http://127.0.0.1:8000/myapp/default/user/login?_next=/myapp/admin/index * common users login through http://127.0.0.1:8000/myapp/default/user/login?_next=/myapp/default/index Everything work as I expected, but when authentication fails both groups are redirect to http://127.0.0.1:8000/myapp/default/user/login. Is it possible to have non-redirection when authentication fails? I've been playing with auth.settings.on_failed_authorization and auth.settings.on_failed_authentication but couldn't get it work. Any help will be appreciated. Joaquin.
Re: [web2py] Re: Best way to return all users who have a specific role?
Are you using the web-based shell in admin? If so, try a regular Python shell instead -- the admin shell seems to have some limitations. On Saturday, March 19, 2011 9:23:37 AM UTC-4, Tom A wrote: Hmm - I spoke too soon. Database changes work OK from controllers but not from shell... On 19 March 2011 13:03, Tom Atkins mink...@gmail.com wrote: Oops - my mistake - I was using Navicat to look at my sqllite database and had left it open. hence sqllite db was locked. On 19 March 2011 10:41, Tom Atkins mink...@gmail.com wrote: Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried this with alternative syntax: auth.add_permission(1, 'read', db.auth_user) 2 and tried other tables: auth.add_permission(1, 'read', db.post) 3 but still no entries in auth_permission. Any ideas? On 18 March 2011 20:08, Massimo Di Pierro massimo@gmail.com wrote: If you have given explicit permission to the group: group_id=auth.add_group('Super Admin') auth.add_permission(group_id, 'read', db.mytable) then you can do: for row in db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL): print row in the case being discussed mytable is auth_user On Mar 18, 2:38 pm, Tom Atkins mink...@gmail.com wrote: Thank you - yes the double hit on the database was what made it seem inelegant to me. Your joined query works fine and I can work with the return data. Any further improvements gratefully received! Hoping Massimo has an undocumented super 1 liner! ;-)
Re: [web2py] Re: 1.94.5 is OUT
Five minutes ago I have downloaded again web2py_win Content of the file web2py\VERSION: Version 1.94.4 (2011-03-18 02:53:34) Regards, Martin 2011/3/19 mart msenecal...@gmail.com Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that says Version 1.94.5 (2011-03-18 20:24:56) so just a mismatch issue (or not letting go of the initial read value?). If no one else spot the problem, then we can say the problem is on my end and that I should probably reboot or something Thanks Massimo! On Mar 19, 2:55 am, kenji4569 hos...@s-cubism.jp wrote: The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo
Re: [web2py] Re: Best way to return all users who have a specific role?
In shell you need to fire db.commit() to persist changes. Em 19/03/2011, às 10:23, Tom Atkins minkto...@gmail.com escreveu: Hmm - I spoke too soon. Database changes work OK from controllers but not from shell... On 19 March 2011 13:03, Tom Atkins minkto...@gmail.com wrote: Oops - my mistake - I was using Navicat to look at my sqllite database and had left it open. hence sqllite db was locked. On 19 March 2011 10:41, Tom Atkins minkto...@gmail.com wrote: Thanks Massimo - I was considering using accessible_query. However, I've now got a problem before I try that - auth.add_permission doesn't seem to be working: auth.add_permission(1, 'read', db.auth_user, 0) 1 but when I look in the auth_permission table there are no entries. I've tried this with alternative syntax: auth.add_permission(1, 'read', db.auth_user) 2 and tried other tables: auth.add_permission(1, 'read', db.post) 3 but still no entries in auth_permission. Any ideas? On 18 March 2011 20:08, Massimo Di Pierro massimo.dipie...@gmail.com wrote: If you have given explicit permission to the group: group_id=auth.add_group('Super Admin') auth.add_permission(group_id, 'read', db.mytable) then you can do: for row in db(auth.accessible_query('read', db.mytable)).select(db.mytable.ALL): print row in the case being discussed mytable is auth_user On Mar 18, 2:38 pm, Tom Atkins minkto...@gmail.com wrote: Thank you - yes the double hit on the database was what made it seem inelegant to me. Your joined query works fine and I can work with the return data. Any further improvements gratefully received! Hoping Massimo has an undocumented super 1 liner! ;-)
[web2py] Using controller in layout
Hi everyone, I've been trying to include a separate page with database code into the layout to no avail. The reason for this is am trying to deploy the application on GAE, and without actually putting the code in a controller, GAE throws a fit on me. A regular database query works fine for the un-GAE version. My setup is: /controllers/default.py: def sidebar_latest(): return dict(latest=db(db.t_problems.id0).select(orderby=~db.t_problems.created_on,limitby=(0,5))) /default/sidebar_latest.html: {{include}} {{for l in latest: =LI(A(l.f_name, _href='/app/default/ problems_read/'+str(l.id))) pass }} (Since I need it in the layout, I removed the extend/layout.html at the top; I still see the proper results) ( layout.html includes web2py_ajax.html, default/sidebar_latest.html) /views/layout.html: div id=sidebar ulli h2Latest Problems/h2 ul {{include 'default/sidebar_latest.html'}} /ul /li/ul /div I receive the error that latest is not defined. I do need the controller to show up on every single page of the site, that's why am trying to include it as such. Obviously, it's failing. If anyone has an idea how to fix it, would be greatly appreciated!
[web2py] Re: Using controller in layout
Have you looked into using components and LOAD: http://web2py.com/book/default/chapter/13#Components? Anthony On Saturday, March 19, 2011 11:13:17 AM UTC-4, Hybride wrote: Hi everyone, I've been trying to include a separate page with database code into the layout to no avail. The reason for this is am trying to deploy the application on GAE, and without actually putting the code in a controller, GAE throws a fit on me. A regular database query works fine for the un-GAE version. My setup is: /controllers/default.py: def sidebar_latest(): return dict(latest=db(db.t_problems.id0).select(orderby=~db.t_problems.created_on,limitby=(0,5))) /default/sidebar_latest.html: {{include}} {{for l in latest: =LI(A(l.f_name, _href='/app/default/ problems_read/'+str(l.id))) pass }} (Since I need it in the layout, I removed the extend/layout.html at the top; I still see the proper results) ( layout.html includes web2py_ajax.html, default/sidebar_latest.html) /views/layout.html: div id=sidebar ulli h2Latest Problems/h2 ul {{include 'default/sidebar_latest.html'}} /ul /li/ul /div I receive the error that latest is not defined. I do need the controller to show up on every single page of the site, that's why am trying to include it as such. Obviously, it's failing. If anyone has an idea how to fix it, would be greatly appreciated!
Re: [web2py] SyntaxError: not enough information to build the url
On Mar 18, 2011, at 2:31 PM, metaperl wrote: The archives have 3 instances of this problem, but their solutions do not apply to me. Here is a link to the ticket for the failed application creation: http://static.livingcosmos.org/tmp/127.0.0.1.2011-03-18.17-17-30.156fa84f-4485-4a40-937d-6bb44d73d60f.html All I tried to do was create a single table with 3 string files NOT NULL. I did not mess with any other defaults. The only unusual thing about the whole procedure was when I accidentally hit + and added a blank table after my table and hit submit. At that point, web2py went back to the table creation screen and only made one table. I'm not very familiar with this code, but... The problem appears to be that, in the wizard, the application name is initialized to '' (an empty string). If you try to use any application link before a name has been successfully assigned, you'll get this error, since URL() can't create a URL without an application name. Whoever does the wizard coding might want to disable the new-application links until it has a name.
[web2py] Re: SyntaxError: not enough information to build the url
Can you point to the other 3 instances of the problem? Can you reproduce the problem, and if so, can you describe the exact steps to do so? And what version of web2py are you using? On Friday, March 18, 2011 5:31:28 PM UTC-4, metaperl wrote: The archives have 3 instances of this problem, but their solutions do not apply to me. Here is a link to the ticket for the failed application creation: http://static.livingcosmos.org/tmp/127.0.0.1.2011-03-18.17-17-30.156fa84f-4485-4a40-937d-6bb44d73d60f.html All I tried to do was create a single table with 3 string files NOT NULL. I did not mess with any other defaults. The only unusual thing about the whole procedure was when I accidentally hit + and added a blank table after my table and hit submit. At that point, web2py went back to the table creation screen and only made one table.
[web2py] Re: Using controller in layout
Exactly what I needed - thanks! Now to fix up the controller, but thank you for point me in the right direction. On Mar 19, 10:25 am, Anthony abasta...@gmail.com wrote: Have you looked into using components and LOAD:http://web2py.com/book/default/chapter/13#Components? Anthony On Saturday, March 19, 2011 11:13:17 AM UTC-4, Hybride wrote: Hi everyone, I've been trying to include a separate page with database code into the layout to no avail. The reason for this is am trying to deploy the application on GAE, and without actually putting the code in a controller, GAE throws a fit on me. A regular database query works fine for the un-GAE version. My setup is: /controllers/default.py: def sidebar_latest(): return dict(latest=db(db.t_problems.id0).select(orderby=~db.t_problems.created_on,limitby=(0,5))) /default/sidebar_latest.html: {{include}} {{for l in latest: =LI(A(l.f_name, _href='/app/default/ problems_read/'+str(l.id))) pass }} (Since I need it in the layout, I removed the extend/layout.html at the top; I still see the proper results) ( layout.html includes web2py_ajax.html, default/sidebar_latest.html) /views/layout.html: div id=sidebar ulli h2Latest Problems/h2 ul {{include 'default/sidebar_latest.html'}} /ul /li/ul /div I receive the error that latest is not defined. I do need the controller to show up on every single page of the site, that's why am trying to include it as such. Obviously, it's failing. If anyone has an idea how to fix it, would be greatly appreciated!
[web2py] Re: why is my database zero-length after commiting a record
your database is located in the folder ../web2py/applications/tmp/ databases/ On 19 Mrz., 00:18, metaperl scheme...@gmail.com wrote: web2py shell transcript of session resulting in no records in sqlite storage.db file after doing an insert with no error: [thequietcenter@ubuntu ~/prg/yinyogaworks] ../web2py/web2py.py -- shell=tmp web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.94.4 (2011-03-18 02:53:34) Database drivers available: SQLite3, pymysql, CouchDB WARNING:web2py:import IPython error; use default python shell Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. (InteractiveConsole) db = DAL('sqlite://storage.db') db.define_table('asanas', Field('name'), Field('img_url'), Field('page_url')) Table {'ALL': gluon.dal.SQLALL object at 0x897b6ac, 'virtualfields': [], '_sequence_name': 'asanas_sequence', 'name': gluon.dal.Field object at 0x897b24c, '_referenced_by': [], 'fields': ['id', 'name', 'img_url', 'page_url'], '_db': DAL {'_lastsql': '', '_db_codec': 'UTF-8', '_fake_migrate': False, '_dbname': 'sqlite', '_adapter': gluon.dal.SQLiteAdapter object at 0x897b2cc, 'check_reserved': None, '_uri': 'sqlite://storage.db', 'tables': ['asanas'], 'asanas': Table {...}, '_migrate': True, '_pool_size': 0}, '_dbt': 'applications/tmp/databases/ fb87181b96a99be45f5a23f4277867ce_asanas.table', '_trigger_name': 'asanas_sequence', '_loggername': 'applications/tmp/databases/ sql.log', '_tablename': 'asanas', '_format': None, '_id': gluon.dal.Field object at 0x897b66c, 'img_url': gluon.dal.Field object at 0x897b40c, 'id': gluon.dal.Field object at 0x897b66c, 'page_url': gluon.dal.Field object at 0x897b5ec} db.asanas.insert(name='placeholder', img_url='http://place', page_url='http://holder') 1 db.commit() [thequietcenter@ubuntu ~/prg/yinyogaworks] ls -l total 12 drwxr-xr-x 2 thequietcenter thequietcenter 4096 2011-03-18 12:10 dojo -rw-r--r-- 1 thequietcenter thequietcenter 1037 2011-03-18 19:07 grab- asanas.py -rw-r--r-- 1 thequietcenter thequietcenter 333 2011-03-18 08:40 grab- asanas.py~ -rw-r--r-- 1 thequietcenter thequietcenter 0 2011-03-18 19:07 storage.db [thequietcenter@ubuntu ~/prg/yinyogaworks]
[web2py] Re: why is my database zero-length after commiting a record
your database is located in the folder ../web2py/applications/tmp/ databases/ On 19 Mrz., 00:18, metaperl scheme...@gmail.com wrote: web2py shell transcript of session resulting in no records in sqlite storage.db file after doing an insert with no error: [thequietcenter@ubuntu ~/prg/yinyogaworks] ../web2py/web2py.py -- shell=tmp web2py Enterprise Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.94.4 (2011-03-18 02:53:34) Database drivers available: SQLite3, pymysql, CouchDB WARNING:web2py:import IPython error; use default python shell Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) [GCC 4.4.3] on linux2 Type help, copyright, credits or license for more information. (InteractiveConsole) db = DAL('sqlite://storage.db') db.define_table('asanas', Field('name'), Field('img_url'), Field('page_url')) Table {'ALL': gluon.dal.SQLALL object at 0x897b6ac, 'virtualfields': [], '_sequence_name': 'asanas_sequence', 'name': gluon.dal.Field object at 0x897b24c, '_referenced_by': [], 'fields': ['id', 'name', 'img_url', 'page_url'], '_db': DAL {'_lastsql': '', '_db_codec': 'UTF-8', '_fake_migrate': False, '_dbname': 'sqlite', '_adapter': gluon.dal.SQLiteAdapter object at 0x897b2cc, 'check_reserved': None, '_uri': 'sqlite://storage.db', 'tables': ['asanas'], 'asanas': Table {...}, '_migrate': True, '_pool_size': 0}, '_dbt': 'applications/tmp/databases/ fb87181b96a99be45f5a23f4277867ce_asanas.table', '_trigger_name': 'asanas_sequence', '_loggername': 'applications/tmp/databases/ sql.log', '_tablename': 'asanas', '_format': None, '_id': gluon.dal.Field object at 0x897b66c, 'img_url': gluon.dal.Field object at 0x897b40c, 'id': gluon.dal.Field object at 0x897b66c, 'page_url': gluon.dal.Field object at 0x897b5ec} db.asanas.insert(name='placeholder', img_url='http://place', page_url='http://holder') 1 db.commit() [thequietcenter@ubuntu ~/prg/yinyogaworks] ls -l total 12 drwxr-xr-x 2 thequietcenter thequietcenter 4096 2011-03-18 12:10 dojo -rw-r--r-- 1 thequietcenter thequietcenter 1037 2011-03-18 19:07 grab- asanas.py -rw-r--r-- 1 thequietcenter thequietcenter 333 2011-03-18 08:40 grab- asanas.py~ -rw-r--r-- 1 thequietcenter thequietcenter 0 2011-03-18 19:07 storage.db [thequietcenter@ubuntu ~/prg/yinyogaworks]
[web2py] Re: my newbie questions have been ignored
Hello Terrance, Sometimes it happens that a question is, by mistake, ignored. That is not your case. The problem is that you posted after 4pm on Friday (US time) and Friday night is not very active time in this group. In fact it is the most active time. I see now all your questions have been answered but some of our most skillful experts. Please let us know if those issues have been resolved. Massimo On Mar 19, 7:19 am, Terrence Brannon scheme...@gmail.com wrote: I have written to this list with my problems *http://groups.google.com/group/web2py/browse_thread/thread/c40a1ddcbc... *http://groups.google.com/group/web2py/browse_thread/thread/692df385b5... and in 24 or so hours there has been no response. I saw the recent reddit threads. I watched the vidoes. I got interested and now I feel forced to look elsewhere. Rapid free support is available for the web frameworks which are objectively inferior to web2py. This may be why web2py doesnt have as much popularity as it deserves: people come, try, fail, dont get support and then are forced to find greener pastures.
[web2py] Re: index.yaml not automatically generated in GAE SDK
Thanks for all replies. I think I understand this much better now. It's great to see an active and helpful user group for web2py, I expect I'll be back in here before too long :-) On Mar 19, 12:45 am, howesc how...@umich.edu wrote: Richard, if your query only orders or filters on a single property no index is required (GAE actually does build an index, but those are auto-generated and do not need to be specified in your index.yaml). some queries that need indexes (assume for a moment that the proper tables are defined): db((db.building.type='house') (db.building.built '2010-01-27')).select() db(db.building.type='house').select(orderby=~db.building.built) glad you are enjoying web2py! christian
[web2py] Re: my newbie questions have been ignored
I looked at both your questions and couldn't really understand what you were reporting.
[web2py] Re: 1.94.5 is OUT
I just did it again and I get 1.94.5. You must be behind a proxy. We do not cache it. On Mar 19, 8:59 am, Martin Weissenboeck mweis...@gmail.com wrote: Five minutes ago I have downloaded again web2py_win Content of the file web2py\VERSION: Version 1.94.4 (2011-03-18 02:53:34) Regards, Martin 2011/3/19 mart msenecal...@gmail.com Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that says Version 1.94.5 (2011-03-18 20:24:56) so just a mismatch issue (or not letting go of the initial read value?). If no one else spot the problem, then we can say the problem is on my end and that I should probably reboot or something Thanks Massimo! On Mar 19, 2:55 am, kenji4569 hos...@s-cubism.jp wrote: The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo
[web2py] Re: SyntaxError: not enough information to build the url
I would suggest trying the simple app creation. It's pretty easy to customize your app manually. And you also get a better understanding of creating models and various other framework aspects. The simple app creations are immediately functional.
Re: [web2py] Re: 1.94.5 is OUT
I do not have any proxy installed, but you are right - Google Chrome makes some strange things. It seems, that Chrome has it's own proxy Now I have used Opera and I have got 1.94.5 2011/3/19 Massimo Di Pierro massimo.dipie...@gmail.com I just did it again and I get 1.94.5. You must be behind a proxy. We do not cache it. On Mar 19, 8:59 am, Martin Weissenboeck mweis...@gmail.com wrote: Five minutes ago I have downloaded again web2py_win Content of the file web2py\VERSION: Version 1.94.4 (2011-03-18 02:53:34) Regards, Martin 2011/3/19 mart msenecal...@gmail.com Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that says Version 1.94.5 (2011-03-18 20:24:56) so just a mismatch issue (or not letting go of the initial read value?). If no one else spot the problem, then we can say the problem is on my end and that I should probably reboot or something Thanks Massimo! On Mar 19, 2:55 am, kenji4569 hos...@s-cubism.jp wrote: The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo -- Mit freundlichen Grüßen / With kind regards Martin Weissenböck Gregor-Mendel-Str. 37, 1190 Wien Austria / European Union Tel +43 1 31400 00 Fax +43 1 31400 700
[web2py] Updating from windows: patch for admin/default.py
This patch (1) repairs a small format error in the code that checks the version : %*s* which caused the check upgrade button to fail (2) restores the upgrade button for windows running from source. The last change is not tested on multiple machines, but the feature is experimental anyway. But feel free to reject this part of the patch. Will send patch by separate mail. Nico de Groot --- applications\admin\controllers\default_1_94_5.pyFri Mar 18 19:24:24 2011 +++ applications\admin\controllers\default.py Sat Mar 19 17:35:56 2011 @@ -76,8 +76,8 @@ return A(T('Unable to check for upgrades'), _href=WEB2PY_URL) elif new_version != True: return A(T('web2py is up to date'), _href=WEB2PY_URL) -elif platform.system().lower() in ('windows','win32','win64'): -return SPAN('You should upgrade to version %' % version_number) +elif platform.system().lower() in ('windows','win32','win64') and os.path.exists(web2py.exe): +return SPAN('You should upgrade to version %s' % version_number) else: return sp_button(URL('upgrade_web2py'), T('upgrade now')) \ + XML(' strong class=upgrade_version%s/strong' % version_number)
[web2py] GAE Tip of the Day - cached static files after version change
Hi all, GAE changed something recently such that when i update my application version it still serves *old* copies of my static files. Bad Google! With the help of some friends here: https://groups.google.com/forum/#!topic/google-appengine/izSeUolA1ho I came up with this for use in web2py: in your app.yaml, change the block for static files to: - url: /(?Pa.+?)/static/.*?/(?Pb.+) static_files: applications/\1/static/\2 upload: applications/(.+?)/static/(.+) secure: optional expiration: 90d note the .*? which will match any string. we are then going to use routes.py to insert a version number in the string in routes.py: import os version_id = os.environ.get('CURRENT_VERSION_ID', '0') ... routes_out = (... ('/$a/static/(?Pf.*)', '/$a/static/%s/$f'%version_id), #add a version id to static links to break the google cache on version changes ...) Note that this does not work if you are serving files that are referenced outside of web2py, or if the url is built without URL(). but for your css and images used internally only it seems to work well. Christian
[web2py] Re: Updating from windows: patch for admin/default.py
Thanks Nico On Mar 19, 12:54 pm, Nico de Groot ndegr...@chello.nl wrote: This patch (1) repairs a small format error in the code that checks the version : %*s* which caused the check upgrade button to fail (2) restores the upgrade button for windows running from source. The last change is not tested on multiple machines, but the feature is experimental anyway. But feel free to reject this part of the patch. Will send patch by separate mail. Nico de Groot --- applications\admin\controllers\default_1_94_5.py Fri Mar 18 19:24:24 2011 +++ applications\admin\controllers\default.py Sat Mar 19 17:35:56 2011 @@ -76,8 +76,8 @@ return A(T('Unable to check for upgrades'), _href=WEB2PY_URL) elif new_version != True: return A(T('web2py is up to date'), _href=WEB2PY_URL) - elif platform.system().lower() in ('windows','win32','win64'): - return SPAN('You should upgrade to version %' % version_number) + elif platform.system().lower() in ('windows','win32','win64') and os.path.exists(web2py.exe): + return SPAN('You should upgrade to version %s' % version_number) else: return sp_button(URL('upgrade_web2py'), T('upgrade now')) \ + XML(' strong class=upgrade_version%s/strong' % version_number)
[web2py] get variables in view from other controller
How can I get variables in view from other controller? For example: mycontroller/ def options(): return dict(a='hello', b='world') and in some view I need something like this: {{ options = mycontroller/options() }} {{=a}} {{=b}}
[web2py] Re: get variables in view from other controller
There are two types of frameworks: push and pull. In push once controller pushes variables to one view. In pull one view pulls variables from multiple controllers. Web2py, Django, TG, Pylons, Pyramid, Flask, are push frameworks. You are trying to use a push framework as a pull one and that is not a good idea. You can ask the browser to pull variables. You can do is via Ajax or using the LOAD helper. massimo On Mar 19, 2:06 pm, LightOfMooN vladsale...@yandex.ru wrote: How can I get variables in view from other controller? For example: mycontroller/ def options(): return dict(a='hello', b='world') and in some view I need something like this: {{ options = mycontroller/options() }} {{=a}} {{=b}}
[web2py] Re: get variables in view from other controller
Yes, I know it. I very like bluebream because of pull (it's not for propagation :) And it's too hard for me to develop without it, but I try. So, maybe is there a way to prepare some variables in some function and then use it by calling prepare-function from needed function? Something like: mycontroller/ def options(): a = ... b = db(...).select() return dict(a=a, b=b) othercontroller/ def index(): options = mycontroller/options() local_one = ... return dict(local_one=local_one, options=options) index.html: {{=local_one}} {{if options['a']==True:}} helloworld {{pass}} Is there a way to do something like this? ( options = mycontroller/options() ) On 20 мар, 00:20, Massimo Di Pierro massimo.dipie...@gmail.com wrote: There are two types of frameworks: push and pull. In push once controller pushes variables to one view. In pull one view pulls variables from multiple controllers. Web2py, Django, TG, Pylons, Pyramid, Flask, are push frameworks. You are trying to use a push framework as a pull one and that is not a good idea. You can ask the browser to pull variables. You can do is via Ajax or using the LOAD helper. massimo On Mar 19, 2:06 pm, LightOfMooN vladsale...@yandex.ru wrote: How can I get variables in view from other controller? For example: mycontroller/ def options(): return dict(a='hello', b='world') and in some view I need something like this: {{ options = mycontroller/options() }} {{=a}} {{=b}}
[web2py] Re: get variables in view from other controller
You're probably better off with LOAD, but if you don't want to use Ajax, maybe exec_environment would work: http://web2py.com/book/default/chapter/04#Execution-Environment Does options() have to be a controller action (i.e., does it ever need to be called via a URL)? If not, you could also simply put it in a module and import it wherever you need it. In that case, I suppose you'd have to explicitly pass db to it as an argument. Anthony On Saturday, March 19, 2011 3:32:08 PM UTC-4, LightOfMooN wrote: Yes, I know it. I very like bluebream because of pull (it's not for propagation :) And it's too hard for me to develop without it, but I try. So, maybe is there a way to prepare some variables in some function and then use it by calling prepare-function from needed function? Something like: mycontroller/ def options(): a = ... b = db(...).select() return dict(a=a, b=b) othercontroller/ def index(): options = mycontroller/options() local_one = ... return dict(local_one=local_one, options=options) index.html: {{=local_one}} {{if options['a']==True:}} helloworld {{pass}} Is there a way to do something like this? ( options = mycontroller/options() ) On 20 мар, 00:20, Massimo Di Pierro massimo@gmail.com wrote: There are two types of frameworks: push and pull. In push once controller pushes variables to one view. In pull one view pulls variables from multiple controllers. Web2py, Django, TG, Pylons, Pyramid, Flask, are push frameworks. You are trying to use a push framework as a pull one and that is not a good idea. You can ask the browser to pull variables. You can do is via Ajax or using the LOAD helper. massimo On Mar 19, 2:06 pm, LightOfMooN vlads...@yandex.ru wrote: How can I get variables in view from other controller? For example: mycontroller/ def options(): return dict(a='hello', b='world') and in some view I need something like this: {{ options = mycontroller/options() }} {{=a}} {{=b}}
[web2py] Re: adding auth later?
Every new app comes with Auth already defined, so you would have to either comment it out or delete completely. its extremely easy to put in. On Mar 19, 4:50 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Basically you would need to add this to model from gluon.tools import Auth auth=Auth(globals(),db) auth.define_tables() and this to controller def user(): return dict(form=auth()) then decorate the actions as usual @auth.requires_login() You may want to customize some settings auth.settings.blablabla = 'blablabla' On Mar 18, 4:53 pm, pbreit pbreitenb...@gmail.com wrote: Dare I say it's not too difficult?
[web2py] Re: get variables in view from other controller
You can set Ajax=False in LOAD(). Does the source function need to be a controller? If not, can you put it in a model or elsewhere?
[web2py] Re: adding auth later?
If you commented out or deleted this line in layout.html, you'd never see Auth: {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}
[web2py] Re: get variables in view from other controller
no, it doesn't be a controller. But I can not use ajax too, because I need variables in template, but not the rendered block. (and I don't like that LOAD() loads components in new div, because it may cause a problems with css and jquery) So, I think, a one good way is to define some function in db.py, which would prepare some variables which I need in every view. On 20 мар, 02:09, pbreit pbreitenb...@gmail.com wrote: You can set Ajax=False in LOAD(). Does the source function need to be a controller? If not, can you put it in a model or elsewhere?
[web2py] Re: adding auth later?
Just check out db.py model file and delete what you dont need. On Mar 19, 9:37 pm, Pystar aitoehi...@gmail.com wrote: Every new app comes with Auth already defined, so you would have to either comment it out or delete completely. its extremely easy to put in. On Mar 19, 4:50 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Basically you would need to add this to model from gluon.tools import Auth auth=Auth(globals(),db) auth.define_tables() and this to controller def user(): return dict(form=auth()) then decorate the actions as usual @auth.requires_login() You may want to customize some settings auth.settings.blablabla = 'blablabla' On Mar 18, 4:53 pm, pbreit pbreitenb...@gmail.com wrote: Dare I say it's not too difficult?
[web2py] Re: get variables in view from other controller
You can drop it anywhere in the models directory. In fact, you could have a utils.py file in models.
[web2py] squeeze + Apache2 = lots of RAM
Anybody is using Apache2 with Debian 6? I just upgraded from Debian 5 to 6, and notice an obscene amount of memory taken by Apache2, which almost 600MB. Unbelievable. In Debian 5, it took about 300MB. I am guessing I'll have to go with another server then.
[web2py] from a csv file to a web2py app
http://vimeo.com/21239786
[web2py] Re: 1.94.5 is OUT
So, there does still seem to be some disconnect between a) what version appAdmin is reading from web2py.com, this is most probably correct b) once upgraded, appAdmin is reporting version 1.94.5 from the main page, and the web2py server console (info/about box) says 1.94.4 (i imagine if I close and restart, 1.94.5 will come up). If I may make a suggestion... When stamping a build as release X, we should stamp each file with version info. In this case, the contents of /gluon should contain files with a version block. Something standard, easy to see at the top (or bottom) of the page and quickly recognizable that looks like a key/value pair (so folk can easily script version validation) I.e. '''---{{WEB2PY VERSION}}---''' '''''' '''--- Release version: 1.94.5 Release date: some date stamp and other release notes you want ---''' '''''' '''---{{WEB2PY VERSION}}---''' THis is easy to do with a one time effort to implement a filestamping routine. Ideally, a manifest would be a nice to have too :). This is what I do @ work for anything I post to internal tools or the build system that I have to support Thanks, Mart :) On Mar 19, 1:41 pm, Martin Weissenboeck mweis...@gmail.com wrote: I do not have any proxy installed, but you are right - Google Chrome makes some strange things. It seems, that Chrome has it's own proxy Now I have used Opera and I have got 1.94.5 2011/3/19 Massimo Di Pierro massimo.dipie...@gmail.com I just did it again and I get 1.94.5. You must be behind a proxy. We do not cache it. On Mar 19, 8:59 am, Martin Weissenboeck mweis...@gmail.com wrote: Five minutes ago I have downloaded again web2py_win Content of the file web2py\VERSION: Version 1.94.4 (2011-03-18 02:53:34) Regards, Martin 2011/3/19 mart msenecal...@gmail.com Hi, Jus tried it (twice) and still no go for me It does spot the correct version when checking , then I can got through the next couple of buttons, and will download. but when I bounced the server, it tells me Version 1.94.4 (2011-03-18 02:53:34) No, just checked the VERSION file and that says Version 1.94.5 (2011-03-18 20:24:56) so just a mismatch issue (or not letting go of the initial read value?). If no one else spot the problem, then we can say the problem is on my end and that I should probably reboot or something Thanks Massimo! On Mar 19, 2:55 am, kenji4569 hos...@s-cubism.jp wrote: The problem is now resolved. Thank you for your quick response. Kenji On 3月19日, 午前5:28, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I apologize, the 1.94.1-4 has had problems with sessions because of recent major refactoring. The latest reported here: http://groups.google.com/group/web2py/msg/59f3716c4dcbdf47 Jonathan figured out the problem and submitted a patch. It passes my tests. Please check it and hopefully the issue is resolved. If you still have problems with sessions, let us know asap. Massimo -- Mit freundlichen Grüßen / With kind regards Martin Weissenböck Gregor-Mendel-Str. 37, 1190 Wien Austria / European Union Tel +43 1 31400 00 Fax +43 1 31400 700
[web2py] Re: my newbie questions have been ignored
Hi Terrance, Welcome to web2py. I think in general you'll find that you get very good support here, particularly given that the community is not huge and everyone here is volunteering their time. Actually, so far I'd say you're doing pretty well -- your first two questions were answered within a few hours, and I'm not sure what time zone you're in, but for most of us, your last two questions (linked below) came in on Friday evening, hence the longer wait until Saturday morning. Also, may I suggest that when you do receive a response, it would be helpful if you could provide some acknowledgment. Of course, a thank you is always nice, but more importantly, we want to know if the answer provided was helpful and how you ultimately solved the problem. This will provide useful information for other current and future readers of the thread, and in some cases help us identify and diagnose bugs. I hope your time with web2py is fun and productive. Best, Anthony On Saturday, March 19, 2011 8:19:19 AM UTC-4, metaperl wrote: I have written to this list with my problems - http://groups.google.com/group/web2py/browse_thread/thread/c40a1ddcbcfe99ea# - http://groups.google.com/group/web2py/browse_thread/thread/692df385b5d3308b# and in 24 or so hours there has been no response. I saw the recent reddit threads. I watched the vidoes. I got interested and now I feel forced to look elsewhere. Rapid free support is available for the web frameworks which are objectively inferior to web2py. This may be why web2py doesnt have as much popularity as it deserves: people come, try, fail, dont get support and then are forced to find greener pastures.
[web2py] Re: from a csv file to a web2py app
Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
[web2py] Re: from a csv file to a web2py app
Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupterm(term=os.environ.get(TERM, unknown),fd=sys.__stdout__.fileno()) for i in range(10): if i0: sys.stdout.write(terminal.UP) sys.stdout.write(str(i)+'\n') time.sleep(0.1) It is part of kryten. It messes up the shell (on Mac, I have not tried on Linux). How do I restore the shell from python programmatically? Massimo On Mar 19, 5:19 pm, mart msenecal...@gmail.com wrote: Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
[web2py] Where is the Shell ????
In version 1.93.2 the web2py not appear because the Shell? where is the Shel on Windows Vista. -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba
[web2py] web2py ProgrammingError: relation auth_user already exists
After upgrading debian to version 6, postgres was upgraded to 8.4. I had to create a new user, new database. Well, this didn't go well. I had previously backed up my database. Now after restoring my postgres db, I had the error above. auth_user already exists. I have no idea how to fix this. Any help is appreciated.
Re: [web2py] Re: from a csv file to a web2py app
On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupterm(term=os.environ.get(TERM, unknown),fd=sys.__stdout__.fileno()) for i in range(10): if i0: sys.stdout.write(terminal.UP) sys.stdout.write(str(i)+'\n') time.sleep(0.1) It is part of kryten. It messes up the shell (on Mac, I have not tried on Linux). How do I restore the shell from python programmatically? That's what endwin is supposed to do, assuming that you terminate normally. But curses.wrapper is a good idea, seems to me. Massimo On Mar 19, 5:19 pm, mart msenecal...@gmail.com wrote: Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
[web2py] Re: from a csv file to a web2py app
for me curses endwin does not restore console settings. I tried curses.wrapper and no luck. On Mar 19, 6:28 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupterm(term=os.environ.get(TERM, unknown),fd=sys.__stdout__.fileno()) for i in range(10): if i0: sys.stdout.write(terminal.UP) sys.stdout.write(str(i)+'\n') time.sleep(0.1) It is part of kryten. It messes up the shell (on Mac, I have not tried on Linux). How do I restore the shell from python programmatically? That's what endwin is supposed to do, assuming that you terminate normally. But curses.wrapper is a good idea, seems to me. Massimo On Mar 19, 5:19 pm, mart msenecal...@gmail.com wrote: Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
Re: [web2py] Re: from a csv file to a web2py app
On Mar 19, 2011, at 4:36 PM, Massimo Di Pierro wrote: for me curses endwin does not restore console settings. I tried curses.wrapper and no luck. curses! There are a couple of stty hacks, if you're willing to call out to stty (with the terminal as stdin). stty sane will do sort of what it implies: restore the terminal to a reasonable setting. More elaborately, you can do this: save_state=$(stty -g) mess it up ... stty $save_state (except pythonically) On Mar 19, 6:28 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupterm(term=os.environ.get(TERM, unknown),fd=sys.__stdout__.fileno()) for i in range(10): if i0: sys.stdout.write(terminal.UP) sys.stdout.write(str(i)+'\n') time.sleep(0.1) It is part of kryten. It messes up the shell (on Mac, I have not tried on Linux). How do I restore the shell from python programmatically? That's what endwin is supposed to do, assuming that you terminate normally. But curses.wrapper is a good idea, seems to me. Massimo On Mar 19, 5:19 pm, mart msenecal...@gmail.com wrote: Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
[web2py] Re: web2py ProgrammingError: relation auth_user already exists
To be clear, essentially this is what happened. I backed up web2py folder, and postgres database separately. Then, I upgraded the os, including postgres to version 8.4. After that, I unzipped the web2py folder and installed the database. And I have this problem. This is quite frustrating. Here's part of the ticket. Any help is greatly appreciated. THANKS. File /home/user/web2py/gluon/tools.py, line 1177, in define_tables format='%(first_name)s %(last_name)s (%(id)s)') File /home/user/web2py/gluon/dal.py, line 3884, in define_table polymodel=polymodel) File /home/user/web2py/gluon/dal.py, line 581, in create_table self.create_sequence_and_triggers(query,table) File /home/user/web2py/gluon/dal.py, line 1575, in create_sequence_and_triggers self.execute(query) File /home/user/web2py/gluon/dal.py, line 1137, in execute return self.log_execute(*a, **b) File /home/user/web2py/gluon/dal.py, line 1134, in log_execute return self.cursor.execute(*a,**b) ProgrammingError: relation auth_user already exists
[web2py] Re: web2py ProgrammingError: relation auth_user already exists
btw, I backed up (in postgres 8.3) using: pg_dump database database.sql and restored (in postgres 8.4) using: psql database database.sql
[web2py] Re: web2py ProgrammingError: relation auth_user already exists
Just a guess, but did you back up the DB and then restore to a different name? It looks like web2py is trying to re-create the DB. Try setting migrate = False, fake_migrate = True. Look up those settings in the book, in the DAL chapter. Regards, D On Mar 20, 12:38 am, VP vtp2...@gmail.com wrote: btw, I backed up (in postgres 8.3) using: pg_dump database database.sql and restored (in postgres 8.4) using: psql database database.sql
[web2py] Re: Where is the Shell ????
Open a dos commandline window, navigate to the web2py directory, type: c:\web2py python web2py.py --help which shows all the options available. Try this: c:\web2py python web2py.py -N -M -S your_app_name_here This opens a shell in the context of your_app, then for example, you may be able to list your tables of that app with this command: db.tables See the book. On Mar 19, 11:05 pm, Ovidio Marinho ovidio...@gmail.com wrote: In version 1.93.2 the web2py not appear because the Shell? where is the Shel on Windows Vista. -- Ovidio Marinho Falcao Neto ovidio...@gmail.com Tecnologia da Informaçao Casa Civil do Governador 83 3214 7885 - 88269088 Paraiba
[web2py] Re: book bugs
:-) On Mar 19, 3:31 am, Kevin Ivarsen kivar...@gmail.com wrote: villas: tonight I went through the edits you made, and just about everything looks like it was correctly added to the book, including these two IS_DATE corrections. Thanks for your work on this! Kevin
[web2py] How to build windows binary yourself?
I was going to take a shot at building my own windows exe version of web2py and see if I could get pyodbc included, but ran into a problem. I started out with the source distribution of web2py 1.94.5. and then ran python setup_exe.py web2py Everything seems to start building OK until it begins to try copying the data files. Setup throws warnings for NEWINSTALL, ABOUT, LICENSE VERSION (btw, splashlogo.gif is missing from the list but needed) because there isn't a destination directory specified. Then as soon as it tries to copy the applications it dies with the following error: can't copy 'applications\examples\controllers': doesn't exist or not a regular file The 'applications\examples\controllers' directory is certainly there, so I'm not sure what's wrong. If I remove the lines in setup_exe.py that add in [x for x in reglob('applications/examples')] + \ [x for x in reglob('applications/welcome')] + \ [x for x in reglob('applications/admin')] then the exe appears to build ok and runs if I copy in the data files from the source dist, but I assume that since the applications are mentioned in the official source they're supposed to be included in the build automatically. Massimo, how do you build the Windows version of web2py?
Re: [web2py] squeeze + Apache2 = lots of RAM
next week I test with that configuration, whatever the result will comment Díaz Luis http://www.facebook.com/diazluis2007 TSU Analisis de Sistemas Universidad de Carabobo Facultad de Odontologíahttp://www.odontologia.uc.edu.ve/index.php?option=com_contentview=articleid=102Itemid=85 2011/3/19 VP vtp2...@gmail.com Anybody is using Apache2 with Debian 6? I just upgraded from Debian 5 to 6, and notice an obscene amount of memory taken by Apache2, which almost 600MB. Unbelievable. In Debian 5, it took about 300MB. I am guessing I'll have to go with another server then.
[web2py] Re: web2py ProgrammingError: relation auth_user already exists
Yes. I've been able to fixed this, but it's ugly. I'm going to create a new topic to describe this problem (this topic is convoluted with many variables (upgrades, etc.)). On Mar 19, 8:29 pm, villas villa...@gmail.com wrote: Just a guess, but did you back up the DB and then restore to a different name? It looks like web2py is trying to re-create the DB. Try setting migrate = False, fake_migrate = True. Look up those settings in the book, in the DAL chapter. Regards, D On Mar 20, 12:38 am, VP vtp2...@gmail.com wrote: btw, I backed up (in postgres 8.3) using: pg_dump database database.sql and restored (in postgres 8.4) using: psql database database.sql
[web2py] Backup/Restore problem with web2py, postgres
I've had problems with backup/restore. These could be very serious problems. So, with version 1.94.5, I simulated a backup/restore scenario and found a problem. 1. Backup up database with (psql_dump database database.sql) 2. Create another database (psql database2 database.sql) 3. Replace database in the connection string with database2. These 3 steps is to simulate a backup/restore scenario. The (uncompiled) codebase remains unchanged during these 3 steps. One would think this should work, but it doesn't; at least with my app. Here's the error's trackback: Traceback (most recent call last): File /home/username/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/username/web2py/applications/phim/models/db.py, line 42, in module auth.define_tables() # creates all needed tables File /home/username/web2py/gluon/tools.py, line 1177, in define_tables format='%(first_name)s %(last_name)s (%(id)s)') File /home/username/web2py/gluon/dal.py, line 3884, in define_table polymodel=polymodel) File /home/username/web2py/gluon/dal.py, line 581, in create_table self.create_sequence_and_triggers(query,table) File /home/username/web2py/gluon/dal.py, line 1575, in create_sequence_and_triggers self.execute(query) File /home/username/web2py/gluon/dal.py, line 1137, in execute return self.log_execute(*a, **b) File /home/username/web2py/gluon/dal.py, line 1134, in log_execute return self.cursor.execute(*a,**b) ProgrammingError: relation auth_user already exists = PS: btw, I'm not modifying auth in anyway. It's web2py's default.
[web2py] Re: from a csv file to a web2py app
Can't blame you for keeping that competitive advantage, it does seem like a winning app to me! :) the py docs do mention using a try/except bloc with wrapper() and also some good info in the python bug reports (http://bugs.python.org/ issue7567 as an example). hope it helps, and let me know if you need something tested on linux, will be glad to help. Thanks, Mart :) On Mar 19, 7:57 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 19, 2011, at 4:36 PM, Massimo Di Pierro wrote: for me curses endwin does not restore console settings. I tried curses.wrapper and no luck. curses! There are a couple of stty hacks, if you're willing to call out to stty (with the terminal as stdin). stty sane will do sort of what it implies: restore the terminal to a reasonable setting. More elaborately, you can do this: save_state=$(stty -g) mess it up ... stty $save_state (except pythonically) On Mar 19, 6:28 pm, Jonathan Lundell jlund...@pobox.com wrote: On Mar 19, 2011, at 3:37 PM, Massimo Di Pierro wrote: Let me keep my competitive advantage for a while. ;-) Besides I have this problem I cannot solve. Consider this code: import terminal import time import sys import curses import os screen = curses.initscr() curses.nocbreak() curses.echo() curses.endwin() curses.noraw() curses.nl() #curses.setupterm(term=os.environ.get(TERM, unknown),fd=sys.__stdout__.fileno()) for i in range(10): if i0: sys.stdout.write(terminal.UP) sys.stdout.write(str(i)+'\n') time.sleep(0.1) It is part of kryten. It messes up the shell (on Mac, I have not tried on Linux). How do I restore the shell from python programmatically? That's what endwin is supposed to do, assuming that you terminate normally. But curses.wrapper is a good idea, seems to me. Massimo On Mar 19, 5:19 pm, mart msenecal...@gmail.com wrote: Massimo, you are enjoying this way too much! ;) Just kidding :) This is fantastic! I love this approach (input csv, process, then output) - its clean, clear, concise and immensely usable! Thanks :) P.s. Can we use your new and amazing application, kryten ? pretty please? :) :) On Mar 19, 6:07 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: http://vimeo.com/21239786
[web2py] Re: How to build windows binary yourself?
I do not build the windows version. I did it once last time 2 years ago. Since than I only replace the pyc files and rezip. It is possible we added some files that broke the py2exe script. Moreover I do not use windows myself. If you have fixed it and want to email a revised script I will post it. On Mar 19, 9:53 pm, Brian M bmere...@gmail.com wrote: I was going to take a shot at building my own windows exe version of web2py and see if I could get pyodbc included, but ran into a problem. I started out with the source distribution of web2py 1.94.5. and then ran python setup_exe.py web2py Everything seems to start building OK until it begins to try copying the data files. Setup throws warnings for NEWINSTALL, ABOUT, LICENSE VERSION (btw, splashlogo.gif is missing from the list but needed) because there isn't a destination directory specified. Then as soon as it tries to copy the applications it dies with the following error: can't copy 'applications\examples\controllers': doesn't exist or not a regular file The 'applications\examples\controllers' directory is certainly there, so I'm not sure what's wrong. If I remove the lines in setup_exe.py that add in [x for x in reglob('applications/examples')] + \ [x for x in reglob('applications/welcome')] + \ [x for x in reglob('applications/admin')] then the exe appears to build ok and runs if I copy in the data files from the source dist, but I assume that since the applications are mentioned in the official source they're supposed to be included in the build automatically. Massimo, how do you build the Windows version of web2py?
[web2py] Re: Backup/Restore problem with web2py, postgres
ask web2py to repair it auth.define_tables(fake_migrate=True) On Mar 19, 10:16 pm, VP vtp2...@gmail.com wrote: I've had problems with backup/restore. These could be very serious problems. So, with version 1.94.5, I simulated a backup/restore scenario and found a problem. 1. Backup up database with (psql_dump database database.sql) 2. Create another database (psql database2 database.sql) 3. Replace database in the connection string with database2. These 3 steps is to simulate a backup/restore scenario. The (uncompiled) codebase remains unchanged during these 3 steps. One would think this should work, but it doesn't; at least with my app. Here's the error's trackback: Traceback (most recent call last): File /home/username/web2py/gluon/restricted.py, line 188, in restricted exec ccode in environment File /home/username/web2py/applications/phim/models/db.py, line 42, in module auth.define_tables() # creates all needed tables File /home/username/web2py/gluon/tools.py, line 1177, in define_tables format='%(first_name)s %(last_name)s (%(id)s)') File /home/username/web2py/gluon/dal.py, line 3884, in define_table polymodel=polymodel) File /home/username/web2py/gluon/dal.py, line 581, in create_table self.create_sequence_and_triggers(query,table) File /home/username/web2py/gluon/dal.py, line 1575, in create_sequence_and_triggers self.execute(query) File /home/username/web2py/gluon/dal.py, line 1137, in execute return self.log_execute(*a, **b) File /home/username/web2py/gluon/dal.py, line 1134, in log_execute return self.cursor.execute(*a,**b) ProgrammingError: relation auth_user already exists = PS: btw, I'm not modifying auth in anyway. It's web2py's default.
[web2py] Re: get variables in view from other controller
On Saturday, March 19, 2011 5:18:23 PM UTC-4, LightOfMooN wrote: no, it doesn't be a controller. But I can not use ajax too, because I need variables in template, but not the rendered block. (and I don't like that LOAD() loads components in new div, because it may cause a problems with css and jquery) As pbreit pointed out, if you don't want Ajax, you can use LOAD(..., ajax=False), and web2py will insert the content on the server side before delivering the page. In that case, I think the DIV that LOAD wraps around the content is unnecessary (as long as ajax_trap is also False -- looks like the DIV is used as the target for the Ajax response). Because LOAD is a helper, you should be able to do some manipulation of it to remove the outer DIV. So, maybe try something like this in your view: {{=LOAD('mycontroller', 'options', ajax=False)[0][0]}} Anthony