Re: [web2py] Re: Debian / Ubuntu packager needed!
Hi Mark, I'm on holiday now until the 13th of April. When I get back I'll continue working on the gluon package. There is not much to document there, it's quite straightforward. If you want to help you could start with developing the setup.py file for the gluon module. You can find the setuptools manual here: http://peak.telecommunity.com/DevCenter/setuptools Regards, Dima. On Sat, 3 Apr 2010 07:01:01 -0700 (PDT), Mark Breedveld m.breedv...@solcon.nl wrote: Hi Dima, I have to plan my work for the coming weeks. Because I was wondering when you could need some help. Because when there is a concrete plan, I could try to start a project at my school. Which could give this project a development boost. We could also start a document on google docs. To make it more collaborative and a good spread of the work. Regards Mark Breedveld, On Mar 23, 8:40 pm, Dima Barsky d...@debian.org wrote: On Mar 23, 6:00 pm, mdipierro mdipie...@cs.depaul.edu wrote: I do not have any object. I think I need more details to understand it better. I think you should give it a shot and we'll see later if we find any problem. I'm not very happy about this, I would prefer to reach an agreement before I start. I would not want to spend several evenings developing something that you eventually reject for some ideological reasons. Let's do it one step at a time. I'll package the gluon module anyway, there seem to be no problems with it. After that I'll try to write down a small document describing the structure of other web2py related packages. If you are happy with it I'll go ahead with the second part. If not, we'll just stop there. Regards, Dima. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Errors with the new version
I also have some comments on the latest version in repo in auth.login() captcha = self.settings.login_captcha or self.settings.captcha this's had a bad effect for web applications having the login form in the index page This made the captcha appear in that form , the thing that had a bad effect on the style so what I suggest is that you can have something like self.settings.login_captcha_enabled = False ... .. captcha = self.settings.login_captcha or self.settings.captcha if self.settings.login_captcha_enabled else None By doing so, every body is happy * Another thing is that I found in def del_membership(self, group_id, user_id=None): revokes membership from group_id to user_id if user_id==None than user_id is that of current logged in user group_id = group_id or self.id_group(role) -- [role is not defined] Did you mean : def del_membership (self, group_id=None, user_id=None, role=None) ? -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: concurrency problem
Thanks for your thoughts. @Yarko the locking code snippet seems useful. In this case, however, my users never updated the same record. The problem was the locking of the complete database each time two users updated or created 'their own' records. @Beerc PostgreSQL did the trick, thanks :) The sqlite docs suggest, however, that it should be possible to have small multi-user applications using sqlite. I mean, a few users reading/writing each 20/30 seconds does not have to be a problem if each request locks the database for x milliseconds. I just incorrectly assumed that handling occasional locks would have been handled somehow by the DAL. Just a thought (don't know if it makes sense): what about implementing a simple sqlite lock handling mechanism into DAL? For example retry to read/write the sqlite database a few times before giving up. Don't know if that's the best approach, but it might have solved my problem (possibly reduce cebergs 5-10% no content problem too) and fascilitate small multi-user projects with web2py+sqlite. I feel a few multi-user writes in 30 seconds should not require me to adopt a full relational database (unnecessary memory footprint for my small project) or writing this lock handling code myself specifically for sqlite (removing some of the advantage for using DAL and sqlite out of the box; one of the reasons to use web2py in the first place). On the other hand installing postgreSQL was easy enough and it's great that I only needed to change 1 line of code in my web2py application :) -Sven -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Errors with the new version
There's also another suggestion The crud.update() forms doesn't display the 'record deleted message' flash message in case of deleting records instead it displays 'record updated' in function update of the Crud class I suggest adding : if form.accepts(request.post_vars, _session, formname=_formname, onvalidation=onvalidation, keepvalues=self.settings.keepvalues): if form.vars.get('delete_this_record', False): message = self.messages.record_deleted -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Unicode characters problem (Dreamhost installation)
Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: concurrency problem
On Apr 4, 5:04 am, Sven svenstrin...@gmail.com wrote: Thanks for your thoughts. @Yarko the locking code snippet seems useful. In this case, however, my users never updated the same record. The problem was the locking of the complete database each time two users updated or created 'their own' records. @Beerc PostgreSQL did the trick, thanks :) The sqlite docs suggest, however, that it should be possible to have small multi-user applications using sqlite. I mean, a few users reading/writing each 20/30 seconds does not have to be a problem if each request locks the database for x milliseconds. I just incorrectly assumed that handling occasional locks would have been handled somehow by the DAL. This (data concurrency / data safety of a database server) belongs with the db, not with the applicaition using it. IF the application using a db implements this, then db becomes (effectively) part of the applicaiton. About sqlite: why insist using it? It is _intentionally_ a light- weight db, used most significantly in embedded contexts (i.e. your cell phone configuration most likely uses sqlite - no multi-user model needed / wanted). TWO questions: have you tried an executesql to send SQLITE CONFIG SERIALIZED? I would try this first _if_ you really have some pertinent, significant situation preventing use of a different database engine. Second: please consider solving your problem by using a full-feature db, such as postgres. This is really the path that (to my eyes) makes the most sense. - Yarko Just a thought (don't know if it makes sense): what about implementing a simple sqlite lock handling mechanism into DAL? For example retry to read/write the sqlite database a few times before giving up. Don't know if that's the best approach, but it might have solved my problem (possibly reduce cebergs 5-10% no content problem too) and fascilitate small multi-user projects with web2py+sqlite. I feel a few multi-user writes in 30 seconds should not require me to adopt a full relational database (unnecessary memory footprint for my small project) or writing this lock handling code myself specifically for sqlite (removing some of the advantage for using DAL and sqlite out of the box; one of the reasons to use web2py in the first place). On the other hand installing postgreSQL was easy enough and it's great that I only needed to change 1 line of code in my web2py application :) -Sven -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] args problem in 1.76.5
After upgrading to web2py version 1.76.5 one of the functions I defined no longer works. I defined a table newsmonth: db.define_table('newsmonth', db.Field('number',type='integer',length=2,default='',notnull=True), db.Field('month',length=14,default='',notnull=True,unique=True), db.Field('publish',type='boolean'), migrate=False) ... which I use to display archived news items per month. Number is the number of the month e.g April 4. Month is a string, for April it reads like: April 2010. Publish defaults to false and is set to true on the 1st of the next month. In the view I have a list with links: March 2010 february 2010 january 2010 When the visitor clicks March 2010, the news table is queried: def archive(): months=db(db.newsmonth.publish==True).select(db.newsmonth.ALL,orderby=~db.newsmonth.id) news=[] month=[] if request.args: news=db(db.news.publishing_date.month()==request.args[0])\ .select(db.news.ALL,orderby=~db.news.publishing_date) month=request.args[1] if not news: response.flash='Select an archived month' else: response.flash='Select an archived month' return dict(months=months,news=news,month=month) month is set to request.args[1], i.e March 2010, and returned to the view: div id=twoColLayout div id=primarycontent div id=month h3Nieuws {{=month.replace('_',' ')}}/h3 table thead tr td/td /tr /thead tbody {{for item in news:}} tr td h5{{=db.news.publishing_date.formatter(item.publishing_date)}}/h5 /td td {{=A(item.title,_onmouseover=this.style.cursor='pointer';,\ _onclick=javascript:newsdetails('%s')%URL(r=request,f='details',args=[item.id]))}} /td /tr {{pass}} /tbody /table /div !-- month -- /div !-- primarycontent -- div id=sidecontent div class=sidebox h3Archived months:/h3 table tbody {{for month in months:}} tr td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td /tr {{pass}} /tbody /table /div !-- sidebox -- /div !-- sidecontent -- /div !-- twoColLayout -- When I expose the archive function, the view displays well. The URL reads like: http://127.0.0.1:8000/init/news/archive However, when I click one of the archived months links I get an invalid request error. The link in the view reads like: a href=init/news/archive/3/March %202010March 2010/a ... the URL in the browser reads like: http://127.0.0.1:8000/init/news/archive/3/maart%202010 Since the function works without args, I suppose the error has something to do with the args, the porblem is I can't figure out what. Kind regards, Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] args problem in 1.76.5
After upgrading to web2py version 1.76.5 one of the functions I defined no longer works. I defined a table newsmonth: db.define_table('newsmonth', db.Field('number',type='integer',length=2,default='',notnull=True), db.Field('month',length=14,default='',notnull=True,unique=True), db.Field('publish',type='boolean'), migrate=False) ... which I use to display archived news items per month. Number is the number of the month e.g April 4. Month is a string, for April it reads like: April 2010. Publish defaults to false and is set to true on the 1st of the next month. In the view I have a list with links: March 2010 february 2010 january 2010 When the visitor clicks March 2010, the news table is queried: def archive(): months=db(db.newsmonth.publish==True).select(db.newsmonth.ALL,orderby=~db.newsmonth.id) news=[] month=[] if request.args: news=db(db.news.publishing_date.month()==request.args[0])\ .select(db.news.ALL,orderby=~db.news.publishing_date) month=request.args[1] if not news: response.flash='Select an archived month' else: response.flash='Select an archived month' return dict(months=months,news=news,month=month) month is set to request.args[1], i.e March 2010, and returned to the view: div id=twoColLayout div id=primarycontent div id=month h3Nieuws {{=month.replace('_',' ')}}/h3 table thead tr td/td /tr /thead tbody {{for item in news:}} tr td h5{{=db.news.publishing_date.formatter(item.publishing_date)}}/h5 /td td {{=A(item.title,_onmouseover=this.style.cursor='pointer';,\ _onclick=javascript:newsdetails('%s')%URL(r=request,f='details',args=[item.id]))}} /td /tr {{pass}} /tbody /table /div !-- month -- /div !-- primarycontent -- div id=sidecontent div class=sidebox h3Archived months:/h3 table tbody {{for month in months:}} tr td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td /tr {{pass}} /tbody /table /div !-- sidebox -- /div !-- sidecontent -- /div !-- twoColLayout -- When I expose the archive function, the view displays well. The URL reads like: http://127.0.0.1:8000/init/news/archive However, when I click one of the archived months links I get an invalid request error. The link in the view reads like: a href=init/news/archive/3/March %202010March 2010/a ... the URL in the browser reads like: http://127.0.0.1:8000/init/news/archive/3/March%202010 Since the function works without args, I suppose the error has something to do with the args, the porblem is I can't figure out what. Kind regards, Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: args problem in 1.76.5
In the view, when I replace: td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td with: td {{=A(month.maand,_href=URL(r=request,args=[3,'maart_2010']))}} /td The function works. When I replace the underscore with a space: td {{=A(month.maand,_href=URL(r=request,args=[3,'maart 2010']))}} /td The space is being replaced with %20 and the function no longer works. Hopes this helps you help me solve the problem. Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: args problem in 1.76.5
In the view, when I replace: td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td with: td {{=A(month.month,_href=URL(r=request,args=[3,'maart_2010']))}} /td The function works. When I replace the underscore with a space: td {{=A(month.month,_href=URL(r=request,args=[3,'maart 2010']))}} /td The space is being replaced with %20 and the function no longer works. Hopes this helps you help me solve the problem. Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] how use python 2.6 ?
Hi, I've installed Python 2.6 and web2py in my windows. but web2py runs under python 2.5 ( i didn't installed 2.5 ), so my installed site-packages are not available for web2py. any one can help me ? Regards -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] how use python 2.6 ?
Hi Web2py-binary-runs-it's-own-python.-you-have-to-use-source-version. On 4 Apr 2010 15:08, Sky hmonfa...@gmail.com wrote: Hi, I've installed Python 2.6 and web2py in my windows. but web2py runs under python 2.5 ( i didn't installed 2.5 ), so my installed site-packages are not available for web2py. any one can help me ? Regards -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com web2py%2bunsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] how use python 2.6 ?
I use python 2.6 too, use source distribution instead of windows one http://www.web2py.com/examples/static/web2py_src.zip it runs without problems on my pc (windows xp) -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Unicode characters problem (Dreamhost installation)
I don't know what I have done, but my test apps have stopped working at all on Dreamhost. The default apps still work fine. Here's the ticket I'm getting when trying to load any app in the browser: Error traceback Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted exec ccode in environment File /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py, line 12, in module db.define_table('todo', db.Field('task')) File /home/alvinru/phonetizer.com/gluon/sql.py, line 239, in __getattr__ def __getattr__(self, key): return self[key] KeyError: 'Field' In file: /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py #!/usr/bin/python # -*- coding: utf-8 -*- try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there db.define_table('todo', db.Field('task')) from gluon.tools import Service # new in web2py 1.56 service = Service(globals()) 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Unicode characters problem (Dreamhost installation)
I seem to have used the wrong old version of web2py, but even now that I've installed the new version, I'm getting a different error: Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted File /home/alvinru/phonetizer.com/applications/welcome/models/db.py, line 15, in module db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB NameError: name 'DAL' is not defined In file: /home/alvinru/phonetizer.com/applications/welcome/models/db.py 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: I don't know what I have done, but my test apps have stopped working at all on Dreamhost. The default apps still work fine. Here's the ticket I'm getting when trying to load any app in the browser: Error traceback Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted exec ccode in environment File /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py, line 12, in module db.define_table('todo', db.Field('task')) File /home/alvinru/phonetizer.com/gluon/sql.py, line 239, in __getattr__ def __getattr__(self, key): return self[key] KeyError: 'Field' In file: /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py #!/usr/bin/python # -*- coding: utf-8 -*- try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there db.define_table('todo', db.Field('task')) from gluon.tools import Service # new in web2py 1.56 service = Service(globals()) 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- Alexei Vinidiktov -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Friendly URLs
Hello! I've installed WordpressClone http://web2py.com/appliances/default/show/36 and i would like to have each post with a friendly url instead of http://domain/blog/default/post/7 have something like http://domain/welcome-to-pypress/ Thank you -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] cx_Oracle segfaults
Hello, I have been using web2py with oracle since few months now. With small loads everything works fine, but when the load grows, often the python process gets killed with a segfault; after few headaches to understand what was going on, I think I spotted the problem and tried a solution that works for me. It seems the cx_Oracle libs when used in threaded programs (such as the web2py server) needs to handle some locking, as suggested in the cx_Oracle documentation found at http://cx-oracle.sourceforge.net/html/module.html [...] The threaded argument is expected to be a boolean expression which indicates whether or not Oracle should use the mode OCI_THREADED to wrap accesses to connections with a mutex. Doing so in single threaded applications imposes a performance penalty of about 10-15% which is why the default is False. [...] I am not 100% sure this was the problem as I couldnt find a reasonable way to prove it; however, since when I applied the following patch (thats the only change I've made) I havent had crashes anymore. So this is the simple patch I used and I propose --- sql.py 2010-04-04 18:18:26.0 +0200 +++ sql_orig.py 2010-04-04 18:17:38.0 +0200 @@ -964,7 +964,7 @@ elif self._uri[:9] == 'oracle://': self._dbname = 'oracle' self._pool_connection(lambda : \ - cx_Oracle.connect(self._uri[9:],threaded=True)) + cx_Oracle.connect(self._uri[9:])) self._cursor = self._connection.cursor() self._execute = lambda a: \ oracle_fix_execute(a,self._cursor.execute) I'd like someone else to confirm this, and I really hope this can help. Kind regards, G. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Errors with the new version
Can you please email me a patch or the updated tools.py? Thanks Massimo On Apr 4, 5:07 am, hamdy.a.farag hamdy.a.fa...@inbox.com wrote: There's also another suggestion The crud.update() forms doesn't display the 'record deleted message' flash message in case of deleting records instead it displays 'record updated' in function update of the Crud class I suggest adding : if form.accepts(request.post_vars, _session, formname=_formname, onvalidation=onvalidation, keepvalues=self.settings.keepvalues): if form.vars.get('delete_this_record', False): message = self.messages.record_deleted -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: args problem in 1.76.5
The problem is that web2py does not like spaces '%20' in url and replaces them with underscore. On Apr 4, 7:20 am, annet annet.verm...@gmail.com wrote: After upgrading to web2py version 1.76.5 one of the functions I defined no longer works. I defined a table newsmonth: db.define_table('newsmonth', db.Field('number',type='integer',length=2,default='',notnull=True), db.Field('month',length=14,default='',notnull=True,unique=True), db.Field('publish',type='boolean'), migrate=False) ... which I use to display archived news items per month. Number is the number of the month e.g April 4. Month is a string, for April it reads like: April 2010. Publish defaults to false and is set to true on the 1st of the next month. In the view I have a list with links: March 2010 february 2010 january 2010 When the visitor clicks March 2010, the news table is queried: def archive(): months=db(db.newsmonth.publish==True).select(db.newsmonth.ALL,orderby=~db.newsmonth.id) news=[] month=[] if request.args: news=db(db.news.publishing_date.month()==request.args[0])\ .select(db.news.ALL,orderby=~db.news.publishing_date) month=request.args[1] if not news: response.flash='Select an archived month' else: response.flash='Select an archived month' return dict(months=months,news=news,month=month) month is set to request.args[1], i.e March 2010, and returned to the view: div id=twoColLayout div id=primarycontent div id=month h3Nieuws {{=month.replace('_',' ')}}/h3 table thead tr td/td /tr /thead tbody {{for item in news:}} tr td h5{{=db.news.publishing_date.formatter(item.publishing_date)}}/h5 /td td {{=A(item.title,_onmouseover=this.style.cursor='pointer';,\ _onclick=javascript:newsdetails('%s')%URL(r=request,f='details',args=[item.id]))}} /td /tr {{pass}} /tbody /table /div !-- month -- /div !-- primarycontent -- div id=sidecontent div class=sidebox h3Archived months:/h3 table tbody {{for month in months:}} tr td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td /tr {{pass}} /tbody /table /div !-- sidebox -- /div !-- sidecontent -- /div !-- twoColLayout -- When I expose the archive function, the view displays well. The URL reads like:http://127.0.0.1:8000/init/news/archive However, when I click one of the archived months links I get an invalid request error. The link in the view reads like: a href=init/news/archive/3/March %202010March 2010/a ... the URL in the browser reads like:http://127.0.0.1:8000/init/news/archive/3/March%202010 Since the function works without args, I suppose the error has something to do with the args, the porblem is I can't figure out what. Kind regards, Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Unicode characters problem (Dreamhost installation)
where d you get it. I do not think this is a new version. On Apr 4, 10:02 am, Alexei Vinidiktov alexei.vinidik...@gmail.com wrote: I seem to have used the wrong old version of web2py, but even now that I've installed the new version, I'm getting a different error: Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted File /home/alvinru/phonetizer.com/applications/welcome/models/db.py, line 15, in module db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB NameError: name 'DAL' is not defined In file: /home/alvinru/phonetizer.com/applications/welcome/models/db.py 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: I don't know what I have done, but my test apps have stopped working at all on Dreamhost. The default apps still work fine. Here's the ticket I'm getting when trying to load any app in the browser: Error traceback Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted exec ccode in environment File /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py, line 12, in module db.define_table('todo', db.Field('task')) File /home/alvinru/phonetizer.com/gluon/sql.py, line 239, in __getattr__ def __getattr__(self, key): return self[key] KeyError: 'Field' In file: /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py #!/usr/bin/python # -*- coding: utf-8 -*- try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there db.define_table('todo', db.Field('task')) from gluon.tools import Service # new in web2py 1.56 service = Service(globals()) 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- Alexei Vinidiktov -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Friendly URLs
that is a very old app. I needs some work. On Apr 4, 10:16 am, Francisco Costa m...@franciscocosta.com wrote: Hello! I've installed WordpressClonehttp://web2py.com/appliances/default/show/36 and i would like to have each post with a friendly url instead ofhttp://domain/blog/default/post/7have something likehttp://domain/welcome-to-pypress/ Thank you -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] Re: Friendly URLs
Francisco, Take a look at some other existing blog examples. mengu's blog - http://github.com/mengu/blog currently running on mengu.net thadeus blogitizor - http://code.google.com/p/blogitizor/ currently running on thadeusb.com -Thadeus On Sun, Apr 4, 2010 at 12:03 PM, mdipierro mdipie...@cs.depaul.edu wrote: that is a very old app. I needs some work. On Apr 4, 10:16 am, Francisco Costa m...@franciscocosta.com wrote: Hello! I've installed WordpressClonehttp://web2py.com/appliances/default/show/36 and i would like to have each post with a friendly url instead ofhttp://domain/blog/default/post/7have something likehttp://domain/welcome-to-pypress/ Thank you -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Errors with the new version
Hello Massimo, last night I sent you a mail about my problem with the new version, did you get it? Just wanted to check if you got it. Kenneth On Apr 4, 7:37 pm, mdipierro mdipie...@cs.depaul.edu wrote: Can you please email me a patch or the updated tools.py? Thanks Massimo On Apr 4, 5:07 am, hamdy.a.farag hamdy.a.fa...@inbox.com wrote: There's also another suggestion The crud.update() forms doesn't display the 'record deleted message' flash message in case of deleting records instead it displays 'record updated' in function update of the Crud class I suggest adding : if form.accepts(request.post_vars, _session, formname=_formname, onvalidation=onvalidation, keepvalues=self.settings.keepvalues): if form.vars.get('delete_this_record', False): message = self.messages.record_deleted -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Friendly URLs
Thank you very much for the examples. I will take a look at the source code. On Apr 4, 6:09 pm, Thadeus Burgess thade...@thadeusb.com wrote: Francisco, Take a look at some other existing blog examples. mengu's blog -http://github.com/mengu/blog currently running on mengu.net thadeus blogitizor -http://code.google.com/p/blogitizor/ currently running on thadeusb.com -Thadeus On Sun, Apr 4, 2010 at 12:03 PM, mdipierro mdipie...@cs.depaul.edu wrote: that is a very old app. I needs some work. On Apr 4, 10:16 am, Francisco Costa m...@franciscocosta.com wrote: Hello! I've installed WordpressClonehttp://web2py.com/appliances/default/show/36 and i would like to have each post with a friendly url instead ofhttp://domain/blog/default/post/7havesomething likehttp://domain/welcome-to-pypress/ Thank you -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: args problem in 1.76.5
It should be noted that there was some work done towards enabling an alternate setting that would allow the developer access to the unchanged (raw) args but it has not been finished yet. This would allow any character set in args which I believe mainly concerns non-English speaking developers/users. If any of you feel, as I do, that this is important please voice your concern. Denes. On Apr 4, 12:01 pm, mdipierro mdipie...@cs.depaul.edu wrote: The problem is that web2py does not like spaces '%20' in url and replaces them with underscore. On Apr 4, 7:20 am, annet annet.verm...@gmail.com wrote: After upgrading to web2py version 1.76.5 one of the functions I defined no longer works. I defined a table newsmonth: db.define_table('newsmonth', db.Field('number',type='integer',length=2,default='',notnull=True), db.Field('month',length=14,default='',notnull=True,unique=True), db.Field('publish',type='boolean'), migrate=False) ... which I use to display archived news items per month. Number is the number of the month e.g April 4. Month is a string, for April it reads like: April 2010. Publish defaults to false and is set to true on the 1st of the next month. In the view I have a list with links: March 2010 february 2010 january 2010 When the visitor clicks March 2010, the news table is queried: def archive(): months=db(db.newsmonth.publish==True).select(db.newsmonth.ALL,orderby=~db.newsmonth.id) news=[] month=[] if request.args: news=db(db.news.publishing_date.month()==request.args[0])\ .select(db.news.ALL,orderby=~db.news.publishing_date) month=request.args[1] if not news: response.flash='Select an archived month' else: response.flash='Select an archived month' return dict(months=months,news=news,month=month) month is set to request.args[1], i.e March 2010, and returned to the view: div id=twoColLayout div id=primarycontent div id=month h3Nieuws {{=month.replace('_',' ')}}/h3 table thead tr td/td /tr /thead tbody {{for item in news:}} tr td h5{{=db.news.publishing_date.formatter(item.publishing_date)}}/h5 /td td {{=A(item.title,_onmouseover=this.style.cursor='pointer';,\ _onclick=javascript:newsdetails('%s')%URL(r=request,f='details',args=[item.id]))}} /td /tr {{pass}} /tbody /table /div !-- month -- /div !-- primarycontent -- div id=sidecontent div class=sidebox h3Archived months:/h3 table tbody {{for month in months:}} tr td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td /tr {{pass}} /tbody /table /div !-- sidebox -- /div !-- sidecontent -- /div !-- twoColLayout -- When I expose the archive function, the view displays well. The URL reads like:http://127.0.0.1:8000/init/news/archive However, when I click one of the archived months links I get an invalid request error. The link in the view reads like: a href=init/news/archive/3/March %202010March 2010/a ... the URL in the browser reads like:http://127.0.0.1:8000/init/news/archive/3/March%202010 Since the function works without args, I suppose the error has something to do with the args, the porblem is I can't figure out what. Kind regards, Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: webserver slow, misreported
I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see start times stored in connections, but I'm not sure that's the right object. On Mar 30, 6:09 am, Timothy Farrell tfarr...@swgen.com wrote: I don't think upgrading will help much since Cherrypy was also slow. However, doing so would help cover all your bases. If you want to use the http log from Rocket you can do this. I'm assuming you invoke web2py.py from a bash script or just run it manually. Paste the following code into the top of web2py.py import logging import logging.handlers log = logging.getLogger('Rocket.Requests') log.setLevel(logging.INFO) log.addHandler(logging.handlers.FileHandler('rocket.log') I, like Yarko, do think this has more to do with something else. At one point web2py had a profiler built-in. That could be a good tool for finding slow spots. -tim On 3/29/2010 7:59 PM, MichaelToomimwrote: Yes, this is on linux! Do you recommend upgrading and trying again? mturk doesn't affect anything, I am just serving webpages that appear in iframes on the mturk website. From our perspective, I'm serving webpages. Do you have a method of logging how much time it takes to serve a page with rocket? Something that I can use instead of httpserver.log? It seems important for me to measure real-world performance, which ab does not do. My server has 768MB ram, and the only thing it does is run this web2py server. I assumed ram was not full, but did not check. I will check next time. On Mar 29, 12:10 pm, Timothy Farrelltfarr...@swgen.com wrote: snip/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: webserver slow, misreported
You are both right that I do not know where the slowness is coming from. My goal is to measure it so that I can narrow in on the problem. So far I know that it is external to web2py because it does not show up in httpserver.log, so my reasoning is to look at rocket which wraps the web2py part. On Apr 4, 4:44 pm, Michael Toomim too...@gmail.com wrote: I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see start times stored in connections, but I'm not sure that's the right object. On Mar 30, 6:09 am, Timothy Farrell tfarr...@swgen.com wrote: I don't think upgrading will help much since Cherrypy was also slow. However, doing so would help cover all your bases. If you want to use the http log from Rocket you can do this. I'm assuming you invoke web2py.py from a bash script or just run it manually. Paste the following code into the top of web2py.py import logging import logging.handlers log = logging.getLogger('Rocket.Requests') log.setLevel(logging.INFO) log.addHandler(logging.handlers.FileHandler('rocket.log') I, like Yarko, do think this has more to do with something else. At one point web2py had a profiler built-in. That could be a good tool for finding slow spots. -tim On 3/29/2010 7:59 PM, MichaelToomimwrote: Yes, this is on linux! Do you recommend upgrading and trying again? mturk doesn't affect anything, I am just serving webpages that appear in iframes on the mturk website. From our perspective, I'm serving webpages. Do you have a method of logging how much time it takes to serve a page with rocket? Something that I can use instead of httpserver.log? It seems important for me to measure real-world performance, which ab does not do. My server has 768MB ram, and the only thing it does is run this web2py server. I assumed ram was not full, but did not check. I will check next time. On Mar 29, 12:10 pm, Timothy Farrelltfarr...@swgen.com wrote: snip/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] Re: args problem in 1.76.5
On Apr 4, 2010, at 4:37 PM, DenesL wrote: It should be noted that there was some work done towards enabling an alternate setting that would allow the developer access to the unchanged (raw) args but it has not been finished yet. This would allow any character set in args which I believe mainly concerns non-English speaking developers/users. If any of you feel, as I do, that this is important please voice your concern. The raw args feature is available in the current release. Specify it for a particular app in routes.py, and request.raw_args will have the unprocessed args. %20 will be converted to space. URL rewriting is still somewhat broken, especially when a ? is involved. I've got a plan to address that too, but I haven't had a lot of time to put in on it. Denes. On Apr 4, 12:01 pm, mdipierro mdipie...@cs.depaul.edu wrote: The problem is that web2py does not like spaces '%20' in url and replaces them with underscore. On Apr 4, 7:20 am, annet annet.verm...@gmail.com wrote: After upgrading to web2py version 1.76.5 one of the functions I defined no longer works. I defined a table newsmonth: db.define_table('newsmonth', db.Field('number',type='integer',length=2,default='',notnull=True), db.Field('month',length=14,default='',notnull=True,unique=True), db.Field('publish',type='boolean'), migrate=False) ... which I use to display archived news items per month. Number is the number of the month e.g April 4. Month is a string, for April it reads like: April 2010. Publish defaults to false and is set to true on the 1st of the next month. In the view I have a list with links: March 2010 february 2010 january 2010 When the visitor clicks March 2010, the news table is queried: def archive(): months=db(db.newsmonth.publish==True).select(db.newsmonth.ALL,orderby=~db.newsmonth.id) news=[] month=[] if request.args: news=db(db.news.publishing_date.month()==request.args[0])\ .select(db.news.ALL,orderby=~db.news.publishing_date) month=request.args[1] if not news: response.flash='Select an archived month' else: response.flash='Select an archived month' return dict(months=months,news=news,month=month) month is set to request.args[1], i.e March 2010, and returned to the view: div id=twoColLayout div id=primarycontent div id=month h3Nieuws {{=month.replace('_',' ')}}/h3 table thead tr td/td /tr /thead tbody {{for item in news:}} tr td h5{{=db.news.publishing_date.formatter(item.publishing_date)}}/h5 /td td {{=A(item.title,_onmouseover=this.style.cursor='pointer';,\ _onclick=javascript:newsdetails('%s')%URL(r=request,f='details',args=[item.id]))}} /td /tr {{pass}} /tbody /table /div !-- month -- /div !-- primarycontent -- div id=sidecontent div class=sidebox h3Archived months:/h3 table tbody {{for month in months:}} tr td {{=A(month.month,_href=URL(r=request,args=[month.number,month.month]))}} /td /tr {{pass}} /tbody /table /div !-- sidebox -- /div !-- sidecontent -- /div !-- twoColLayout -- When I expose the archive function, the view displays well. The URL reads like:http://127.0.0.1:8000/init/news/archive However, when I click one of the archived months links I get an invalid request error. The link in the view reads like: a href=init/news/archive/3/March %202010March 2010/a ... the URL in the browser reads like:http://127.0.0.1:8000/init/news/archive/3/March%202010 Since the function works without args, I suppose the error has something to do with the args, the porblem is I can't figure out what. Kind regards, Annet. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: webserver slow, misreported
Let us know if you discover anything or if we can help with tests. Can anybody else reproduce this problem? On Apr 4, 6:46 pm, Michael Toomim too...@gmail.com wrote: You are both right that I do not know where the slowness is coming from. My goal is to measure it so that I can narrow in on the problem. So far I know that it is external to web2py because it does not show up in httpserver.log, so my reasoning is to look at rocket which wraps the web2py part. On Apr 4, 4:44 pm, Michael Toomim too...@gmail.com wrote: I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see start times stored in connections, but I'm not sure that's the right object. On Mar 30, 6:09 am, Timothy Farrell tfarr...@swgen.com wrote: I don't think upgrading will help much since Cherrypy was also slow. However, doing so would help cover all your bases. If you want to use the http log from Rocket you can do this. I'm assuming you invoke web2py.py from a bash script or just run it manually. Paste the following code into the top of web2py.py import logging import logging.handlers log = logging.getLogger('Rocket.Requests') log.setLevel(logging.INFO) log.addHandler(logging.handlers.FileHandler('rocket.log') I, like Yarko, do think this has more to do with something else. At one point web2py had a profiler built-in. That could be a good tool for finding slow spots. -tim On 3/29/2010 7:59 PM, MichaelToomimwrote: Yes, this is on linux! Do you recommend upgrading and trying again? mturk doesn't affect anything, I am just serving webpages that appear in iframes on the mturk website. From our perspective, I'm serving webpages. Do you have a method of logging how much time it takes to serve a page with rocket? Something that I can use instead of httpserver.log? It seems important for me to measure real-world performance, which ab does not do. My server has 768MB ram, and the only thing it does is run this web2py server. I assumed ram was not full, but did not check. I will check next time. On Mar 29, 12:10 pm, Timothy Farrelltfarr...@swgen.com wrote: snip/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] Re: Unicode characters problem (Dreamhost installation)
I got it from web2py.com. I'm sure that I've now installed web2py 1.76.5. The strange thing is an older version that used to work fine before I installed 1.76.5 is now giving me the same error message as the 1.76.5 one. The oldest of all three though seems to work but not entirely (see my second message). I guess something went wrong on Dreamhost's end (or rather I did something wrong), but I can't think of what it may be. I wonder where I should look. 2010/4/5 mdipierro mdipie...@cs.depaul.edu: where d you get it. I do not think this is a new version. On Apr 4, 10:02 am, Alexei Vinidiktov alexei.vinidik...@gmail.com wrote: I seem to have used the wrong old version of web2py, but even now that I've installed the new version, I'm getting a different error: Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted File /home/alvinru/phonetizer.com/applications/welcome/models/db.py, line 15, in module db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB NameError: name 'DAL' is not defined In file: /home/alvinru/phonetizer.com/applications/welcome/models/db.py 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: I don't know what I have done, but my test apps have stopped working at all on Dreamhost. The default apps still work fine. Here's the ticket I'm getting when trying to load any app in the browser: Error traceback Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted exec ccode in environment File /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py, line 12, in module db.define_table('todo', db.Field('task')) File /home/alvinru/phonetizer.com/gluon/sql.py, line 239, in __getattr__ def __getattr__(self, key): return self[key] KeyError: 'Field' In file: /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py #!/usr/bin/python # -*- coding: utf-8 -*- try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there db.define_table('todo', db.Field('task')) from gluon.tools import Service # new in web2py 1.56 service = Service(globals()) 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- Alexei Vinidiktov -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: Unicode characters problem (Dreamhost installation)
this is a very strange error, as if one of the system files were corrupted. I would remover everything web2py re-unzip it and copy your applications back in applications. Massimo On Apr 4, 7:28 pm, Alexei Vinidiktov alexei.vinidik...@gmail.com wrote: I got it from web2py.com. I'm sure that I've now installed web2py 1.76.5. The strange thing is an older version that used to work fine before I installed 1.76.5 is now giving me the same error message as the 1.76.5 one. The oldest of all three though seems to work but not entirely (see my second message). I guess something went wrong on Dreamhost's end (or rather I did something wrong), but I can't think of what it may be. I wonder where I should look. 2010/4/5 mdipierro mdipie...@cs.depaul.edu: where d you get it. I do not think this is a new version. On Apr 4, 10:02 am, Alexei Vinidiktov alexei.vinidik...@gmail.com wrote: I seem to have used the wrong old version of web2py, but even now that I've installed the new version, I'm getting a different error: Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted File /home/alvinru/phonetizer.com/applications/welcome/models/db.py, line 15, in module db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB NameError: name 'DAL' is not defined In file: /home/alvinru/phonetizer.com/applications/welcome/models/db.py 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: I don't know what I have done, but my test apps have stopped working at all on Dreamhost. The default apps still work fine. Here's the ticket I'm getting when trying to load any app in the browser: Error traceback Traceback (most recent call last): File /home/alvinru/phonetizer.com/gluon/restricted.py, line 62, in restricted exec ccode in environment File /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py, line 12, in module db.define_table('todo', db.Field('task')) File /home/alvinru/phonetizer.com/gluon/sql.py, line 239, in __getattr__ def __getattr__(self, key): return self[key] KeyError: 'Field' In file: /home/alvinru/phonetizer.com/applications/pyjamas/models/db.py #!/usr/bin/python # -*- coding: utf-8 -*- try: from gluon.contrib.gql import * # if running on Google App Engine except: db = SQLDB('sqlite://storage.db') # if not, use SQLite or other DB else: db = GQLDB() # connect to Google BigTable session.connect(request, response, db=db) # and store sessions there db.define_table('todo', db.Field('task')) from gluon.tools import Service # new in web2py 1.56 service = Service(globals()) 2010/4/4 Alexei Vinidiktov alexei.vinidik...@gmail.com: Hello, I've deployed the latest version of web2py on Dreamhost using wsgi. I'm using a custom installation of Python 2.5. The web2py installation seems to work fine, but there's one problem. I've created a test program using the qooxdoo web application framework for the GUI part which mimics the functionality in the pyjamas example program: displaying a list of todo items, adding and deleting items. It works fine on my local development machine, it works fine on GAE, but on my Dreamhost installation I'm getting an error when trying to add a task that contains non ascii symbols, for example Russian characters as in задание номер один (task number one). I also have a pyjamas version of the same todo app and it exhibits the same behavior (works fine on GAE, not so on Dreamhost). Here is the message that I get back from the xmlrpc method call to addTask: Exception during async call: UNEXPECTED origin undefined error 100: UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) You can see it live here: http://www.phonetizer.com/qooxdoo The pyjamas version is here: http://www.phonetizer.com/pyjamas It is also deployed on GAE and works fine here: http://web2pyapp.appspot.com/qooxdoo I also have a much older version of web2py deployed on Dreamhost. Unlike the new version it uses fastcgi and works as expected. Do you have any ideas as to why the newer version is misbehaving? Thanks. -- Alexei Vinidiktov -- Alexei Vinidiktov -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/web2py?hl=en. -- Alexei Vinidiktov -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from
[web2py] Re: cx_Oracle segfaults
Thank you Gabriele, is should definitively be threaded=False and not True since web2py does not share connection between threads. Yet, this is already the default. You must be running an older version of web2py.You should upgrade. Massimo On Apr 4, 11:33 am, Gabriele Alberti gabriele.albe...@gmail.com wrote: Hello, I have been using web2py with oracle since few months now. With small loads everything works fine, but when the load grows, often the python process gets killed with a segfault; after few headaches to understand what was going on, I think I spotted the problem and tried a solution that works for me. It seems the cx_Oracle libs when used in threaded programs (such as the web2py server) needs to handle some locking, as suggested in the cx_Oracle documentation found at http://cx-oracle.sourceforge.net/html/module.html [...] The threaded argument is expected to be a boolean expression which indicates whether or not Oracle should use the mode OCI_THREADED to wrap accesses to connections with a mutex. Doing so in single threaded applications imposes a performance penalty of about 10-15% which is why the default is False. [...] I am not 100% sure this was the problem as I couldnt find a reasonable way to prove it; however, since when I applied the following patch (thats the only change I've made) I havent had crashes anymore. So this is the simple patch I used and I propose --- sql.py 2010-04-04 18:18:26.0 +0200 +++ sql_orig.py 2010-04-04 18:17:38.0 +0200 @@ -964,7 +964,7 @@ elif self._uri[:9] == 'oracle://': self._dbname = 'oracle' self._pool_connection(lambda : \ - cx_Oracle.connect(self._uri[9:],threaded=True)) + cx_Oracle.connect(self._uri[9:])) self._cursor = self._connection.cursor() self._execute = lambda a: \ oracle_fix_execute(a,self._cursor.execute) I'd like someone else to confirm this, and I really hope this can help. Kind regards, G. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] How to use virtualfields?
Hi there, I search virtualfields in http://www.web2py.com/book but found nothing. So I read this post instead: https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6d836?tvc=1 But I found that db.table.virtualfields.add(ComputedFields()) doesn't work. Only this work: rows.setvirtualfields(table=ComputedFields()) Does the former syntax really supposed to exist? I am using web2py 1.75.4 Regards, Iceberg -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
Re: [web2py] How to use virtualfields?
I think its db.table.virtualfields.append() -Thadeus On Sun, Apr 4, 2010 at 10:51 PM, Iceberg iceb...@21cn.com wrote: Hi there, I search virtualfields in http://www.web2py.com/book but found nothing. So I read this post instead: https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6d836?tvc=1 But I found that db.table.virtualfields.add(ComputedFields()) doesn't work. Only this work: rows.setvirtualfields(table=ComputedFields()) Does the former syntax really supposed to exist? I am using web2py 1.75.4 Regards, Iceberg -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: webserver slow, misreported
Some more questions: how much ram? can you check memory usage? A memory leak may cause slowness. are you using cron? when cron starts it may spike memory usage. are you experience the slowness from localhost or from remote machines? On Apr 4, 6:46 pm, Michael Toomim too...@gmail.com wrote: You are both right that I do not know where the slowness is coming from. My goal is to measure it so that I can narrow in on the problem. So far I know that it is external to web2py because it does not show up in httpserver.log, so my reasoning is to look at rocket which wraps the web2py part. On Apr 4, 4:44 pm, Michael Toomim too...@gmail.com wrote: I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see start times stored in connections, but I'm not sure that's the right object. On Mar 30, 6:09 am, Timothy Farrell tfarr...@swgen.com wrote: I don't think upgrading will help much since Cherrypy was also slow. However, doing so would help cover all your bases. If you want to use the http log from Rocket you can do this. I'm assuming you invoke web2py.py from a bash script or just run it manually. Paste the following code into the top of web2py.py import logging import logging.handlers log = logging.getLogger('Rocket.Requests') log.setLevel(logging.INFO) log.addHandler(logging.handlers.FileHandler('rocket.log') I, like Yarko, do think this has more to do with something else. At one point web2py had a profiler built-in. That could be a good tool for finding slow spots. -tim On 3/29/2010 7:59 PM, MichaelToomimwrote: Yes, this is on linux! Do you recommend upgrading and trying again? mturk doesn't affect anything, I am just serving webpages that appear in iframes on the mturk website. From our perspective, I'm serving webpages. Do you have a method of logging how much time it takes to serve a page with rocket? Something that I can use instead of httpserver.log? It seems important for me to measure real-world performance, which ab does not do. My server has 768MB ram, and the only thing it does is run this web2py server. I assumed ram was not full, but did not check. I will check next time. On Mar 29, 12:10 pm, Timothy Farrelltfarr...@swgen.com wrote: snip/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: How to use virtualfields?
Actually I did notice that typo, I tried the append() already, my code is: class VirtualFields: def profit(self): return self.Orders.income - self.Orders.cost db.Orders.virtualfields.append(VirtualFields()) this line runs fine, but later when I need to access a virtual field, an exception is raised: File C:\DOWNLOAD\google_appengine\web2py\gluon\sql.py, line 658, in __getitem__ return dict.__getitem__(self, key) KeyError: 'profit' Ideas? Thanks. -Iceberg On Apr5, 12:00pm, Thadeus Burgess thade...@thadeusb.com wrote: I think its db.table.virtualfields.append() -Thadeus On Sun, Apr 4, 2010 at 10:51 PM, Iceberg iceb...@21cn.com wrote: Hi there, I search virtualfields inhttp://www.web2py.com/bookbut found nothing. So I read this post instead: https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6... But I found that db.table.virtualfields.add(ComputedFields()) doesn't work. Only this work: rows.setvirtualfields(table=ComputedFields()) Does the former syntax really supposed to exist? I am using web2py 1.75.4 Regards, Iceberg -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: How to use virtualfields?
I just did this as a test and it worked: db=DAL('sqlite:memory:') db.define_table('test',Field('quantity','integer')) class VirtualFields(): ... def profit(self): return self.test.quantity*100 db.test.virtualfields.append(VirtualFields()) db.test.insert(quantity=5) 1 rows=db(db.test.id0).select() for row in rows: print row ... Row {'update_record': function lambda at 0x1b8dbb0, 'profit': 500, 'id': 1, 'delete_record': function lambda at 0x1b8dab0, 'quantity': 5} Sure you are running an updated version of web2py? Which os? which version? On Apr 4, 11:09 pm, Iceberg iceb...@21cn.com wrote: Actually I did notice that typo, I tried the append() already, my code is: class VirtualFields: def profit(self): return self.Orders.income - self.Orders.cost db.Orders.virtualfields.append(VirtualFields()) this line runs fine, but later when I need to access a virtual field, an exception is raised: File C:\DOWNLOAD\google_appengine\web2py\gluon\sql.py, line 658, in __getitem__ return dict.__getitem__(self, key) KeyError: 'profit' Ideas? Thanks. -Iceberg On Apr5, 12:00pm, Thadeus Burgess thade...@thadeusb.com wrote: I think its db.table.virtualfields.append() -Thadeus On Sun, Apr 4, 2010 at 10:51 PM, Iceberg iceb...@21cn.com wrote: Hi there, I search virtualfields inhttp://www.web2py.com/bookbutfound nothing. So I read this post instead: https://groups.google.com/group/web2py/browse_frm/thread/d59ee3d6c2e6... But I found that db.table.virtualfields.add(ComputedFields()) doesn't work. Only this work: rows.setvirtualfields(table=ComputedFields()) Does the former syntax really supposed to exist? I am using web2py 1.75.4 Regards, Iceberg -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group athttp://groups.google.com/group/web2py?hl=en. -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: webserver slow, misreported
I started using apache with mod_wsgi, and now it's fast! So this indicates it's a problem that only occurs when using rocket or cherrypy, but again I'm only measuring it with firebug in my browser. I have 768MB of ram, ~500MB free. I use cron for @reboot only. I only run it on a remote machine (on slicehost VPS). I do not think it is network problems because it is fast in my web browser until I get hit by a bunch of users. Of course I'd like to eliminate the network from my measurements, but for that I need webserver processing- time logs. On Apr 4, 9:08 pm, mdipierro mdipie...@cs.depaul.edu wrote: Some more questions: how much ram? can you check memory usage? A memory leak may cause slowness. are you using cron? when cron starts it may spike memory usage. are you experience the slowness from localhost or from remote machines? On Apr 4, 6:46 pm, Michael Toomim too...@gmail.com wrote: You are both right that I do not know where the slowness is coming from. My goal is to measure it so that I can narrow in on the problem. So far I know that it is external to web2py because it does not show up in httpserver.log, so my reasoning is to look at rocket which wraps the web2py part. On Apr 4, 4:44 pm, Michael Toomim too...@gmail.com wrote: I see, thank you. I want to measure the web server's response time when I deploy this on turk... Unfortunately the rocket log does not report time to serve a request. Do you think it is easy to get that information from rocket? Do you store the start and stop times for each request? I see start times stored in connections, but I'm not sure that's the right object. On Mar 30, 6:09 am, Timothy Farrell tfarr...@swgen.com wrote: I don't think upgrading will help much since Cherrypy was also slow. However, doing so would help cover all your bases. If you want to use the http log from Rocket you can do this. I'm assuming you invoke web2py.py from a bash script or just run it manually. Paste the following code into the top of web2py.py import logging import logging.handlers log = logging.getLogger('Rocket.Requests') log.setLevel(logging.INFO) log.addHandler(logging.handlers.FileHandler('rocket.log') I, like Yarko, do think this has more to do with something else. At one point web2py had a profiler built-in. That could be a good tool for finding slow spots. -tim On 3/29/2010 7:59 PM, MichaelToomimwrote: Yes, this is on linux! Do you recommend upgrading and trying again? mturk doesn't affect anything, I am just serving webpages that appear in iframes on the mturk website. From our perspective, I'm serving webpages. Do you have a method of logging how much time it takes to serve a page with rocket? Something that I can use instead of httpserver.log? It seems important for me to measure real-world performance, which ab does not do. My server has 768MB ram, and the only thing it does is run this web2py server. I assumed ram was not full, but did not check. I will check next time. On Mar 29, 12:10 pm, Timothy Farrelltfarr...@swgen.com wrote: snip/ -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: concurrency problem
Yarko, you suggest using a full-featured db instead of sqlite. But sqlite's internal reader/writer lock is one thing, the overwrite problem is another. No matter what kind of db we are using, we still need to deal with the overwrite problem. Scenario: 9:00am clerk Adam read the balance of a client's account, it is $100 9:01am clerk Bob read the balance of same client, it is $100 9:02am clerk Adam plans to deduct $10 from the account, and updating the new balance as $90 9:03am NOT knowing what Adam had done, Bob plans to deduct $20 from the account, and updating the new balance as $80 There is no physical concurrency here. But we need some measure to refuse Bob's last attempt. There is this kind of measures, such as optimistic lock mechanism in the app level. What I want to discuss is that, do we need implement optimistic lock in our every web2py app, or can/need we do something in DAL level, such as PyDbLite did by the __version field, to benefit all web2py app? Ideas? Thanks. iceberg On Apr3, 8:18pm, Iceberg iceb...@21cn.com wrote: Yarko, you also raise a very good point. And this makes me feel nervous, because all my previous web app are vulnerable to this overwrite issue. :-/ Besides the locking plugin, which is optional and not aware by everyone, do you think we can add some built-in, anti-overwrite protection inside DAL? For example, if the table contains a field named __version__, then DAL is responsible for automatically perform version check before every update(). The idea is borrowed from PyDbLite (http://pypi.python.org/pypi/PyDbLite/2.3). And perhaps DAL can do more, by raise exception when concurrent modification is detected during crud.update(). Quoted from http://www.pydblite.net/en/PyDbLite.html - another internal field called __version__ is also managed by the database engine. It is a integer which is set to 0 when the record is created, then incremented by 1 each time the record is updated. This is used to detect concurrency control, for instance in a web application where 2 users select the same record and want to update it at the same time Regards, Iceberg On Apr2, 10:44pm, Yarko Tymciurak resultsinsoftw...@gmail.com wrote: The first thing I thought of when I read your post was this:http://web2py.com/plugins/default/locking and I wondered how you implemented your solution. I could imagine, if two users open a form, and both submit form.id 2, one will overwrite the other's. (hope this is helpful) Regards, - Yarko On Apr 2, 5:00 am, Sven svenstrin...@gmail.com wrote: Hi, I programmed a psychological experiment in flash and store answers/ results in a sqlite database using web2py (behind nginx server + fastcgi) and pyamf. Everything seems to be all right when I test it, but with as few as 2 simultaneous users I (sometimes) run into trouble. A try with seven simultaneous users resulted in only 2 succesfully stored experimental data.sets I find it very hard to debug, since there are no tickets in web2py. Flash does sometimes produce a remoting error in that situation, but without too much information. I seems to me there is some kind of concurrency problem, but I assumed web2py/sqlite would take care of that for me. Or should I explicitly deal with this? Explicitly commit, check if inserts and updates were successful and if not try again? Any suggestions, comments ideas would be really appreciated. Thanks. Sven -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.
[web2py] Re: concurrency problem
This is a good point. I do not think this should be dealt with at the DB level because, if I understand it is an app workflow problem. If I understand For every user there are two HTTP requests (one to generate the update form, one to submit the form) and each is executed in its own transaction. So the only problem is when the data changes in DB for the record in question in between the two requests. This cannot be solved at the DB level because you do not want to lock the record in one request and unlock in the second request since the second may never arrive (user reload page, click back button, connection is dropped, etc.). This much be resolved by an explicit check that the record content in between requests has not changed. I have once posted an example of how to do it with web2py but now I cannot find it. Anyway, this can be done easily at the app level by adding a timestamp to the record and checking onvalidation that the record timestamp did not change in between the two requests. This should not be default web2py behaviors since the check depends on the model and, moreover, it may be slow and un-necessary in the general case. Like we have onaccept=crud.archive, we could have a onvalidate=curd.unmodified to provide a standard API to perform this check. I will put it in my todo list. Massimo On Apr 4, 11:59 pm, Iceberg iceb...@21cn.com wrote: Yarko, you suggest using a full-featured db instead of sqlite. But sqlite's internal reader/writer lock is one thing, the overwrite problem is another. No matter what kind of db we are using, we still need to deal with the overwrite problem. Scenario: 9:00am clerk Adam read the balance of a client's account, it is $100 9:01am clerk Bob read the balance of same client, it is $100 9:02am clerk Adam plans to deduct $10 from the account, and updating the new balance as $90 9:03am NOT knowing what Adam had done, Bob plans to deduct $20 from the account, and updating the new balance as $80 There is no physical concurrency here. But we need some measure to refuse Bob's last attempt. There is this kind of measures, such as optimistic lock mechanism in the app level. What I want to discuss is that, do we need implement optimistic lock in our every web2py app, or can/need we do something in DAL level, such as PyDbLite did by the __version field, to benefit all web2py app? Ideas? Thanks. iceberg On Apr3, 8:18pm, Iceberg iceb...@21cn.com wrote: Yarko, you also raise a very good point. And this makes me feel nervous, because all my previous web app are vulnerable to this overwrite issue. :-/ Besides the locking plugin, which is optional and not aware by everyone, do you think we can add some built-in, anti-overwrite protection inside DAL? For example, if the table contains a field named __version__, then DAL is responsible for automatically perform version check before every update(). The idea is borrowed from PyDbLite (http://pypi.python.org/pypi/PyDbLite/2.3). And perhaps DAL can do more, by raise exception when concurrent modification is detected during crud.update(). Quoted fromhttp://www.pydblite.net/en/PyDbLite.html - another internal field called __version__ is also managed by the database engine. It is a integer which is set to 0 when the record is created, then incremented by 1 each time the record is updated. This is used to detect concurrency control, for instance in a web application where 2 users select the same record and want to update it at the same time Regards, Iceberg On Apr2, 10:44pm, Yarko Tymciurak resultsinsoftw...@gmail.com wrote: The first thing I thought of when I read your post was this:http://web2py.com/plugins/default/locking and I wondered how you implemented your solution. I could imagine, if two users open a form, and both submit form.id 2, one will overwrite the other's. (hope this is helpful) Regards, - Yarko On Apr 2, 5:00 am, Sven svenstrin...@gmail.com wrote: Hi, I programmed a psychological experiment in flash and store answers/ results in a sqlite database using web2py (behind nginx server + fastcgi) and pyamf. Everything seems to be all right when I test it, but with as few as 2 simultaneous users I (sometimes) run into trouble. A try with seven simultaneous users resulted in only 2 succesfully stored experimental data.sets I find it very hard to debug, since there are no tickets in web2py. Flash does sometimes produce a remoting error in that situation, but without too much information. I seems to me there is some kind of concurrency problem, but I assumed web2py/sqlite would take care of that for me. Or should I explicitly deal with this? Explicitly commit, check if inserts and updates were successful and if not try again? Any suggestions, comments ideas would be really appreciated. Thanks. Sven -- You received this message because you are
[web2py] Re: how use python 2.6 ?
thanks for your help!. it worked ! On Apr 4, 6:11 pm, Vasile Ermicioi elff...@gmail.com wrote: I use python 2.6 too, use source distribution instead of windows onehttp://www.web2py.com/examples/static/web2py_src.zip it runs without problems on my pc (windows xp) -- You received this message because you are subscribed to the Google Groups web2py-users group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.