[web2py] form.accepts for many buttons
how check what button is pressed? form = FORM( DIV(LABEL(T(' as:')), INPUT(_name='numbs', _class='numb'), BUTTON(T(' Team '), _class='btn-primary', _value='team'),' ', BUTTON(T(' Color '), _class='btn-primary', _value='color'),' ', BUTTON(T(' Good '), _class='btn-primary', _value='good'), _class='col-sm-8'), ) if form.accepts(request, session, keepvalues=True, formname='make_wager'): .print form.button.name ?? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] post does not appear in this forum, why ?
hello i have a friend that posted a question in this forum for the first time but it is not visible so far. Do you have a queue to authorize posts to be visible in this forum ? Regards António -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] MSSQL and Unicode problems
Here's a question for those of you experienced integrating MSSQL and web2py. My web2py apps connect to a legacy SQL Server 2005 database, but I'm running into a problem where any attempts to *insert *unicode data into my nvarchar fields breaks the encoding (Renée - Renée) It seems the Unicode query strings get to SQL Server, but are then assumed to be ASCII (there's no leading N before the string literals), and get encoded. Switching the DAL to use MSSQL2 fixes the problem, as it converts *all* queries to ASCII: def execute(self,a): return self.log_execute(a.decode('utf8')) But I understand MSSQL2 is experimental, possibly deprecated, and many of you must be managing to work with Unicode data just fine using the MSSQL/3/4 adapters. This issue occurs in both a linux stack (Web2py pypyodbc freetds 8.0 MSSQL2005) and web2py running on a local windows machine (web2py pyodbc Windows ODBC? MSSQL2005) Any thoughts? Has anyone else run into this? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: form.accepts for many buttons
solved: insert _name='selected' in BUTTON then catch request.vars.get('selected') вторник, 7 апреля 2015 г., 10:26:25 UTC+3 пользователь Dmitry Ermolaev написал: how check what button is pressed? form = FORM( DIV(LABEL(T(' as:')), INPUT(_name='numbs', _class='numb'), BUTTON(T(' Team '), _class='btn-primary', _value='team'),' ', BUTTON(T(' Color '), _class='btn-primary', _value='color'),' ', BUTTON(T(' Good '), _class='btn-primary', _value='good'), _class='col-sm-8'), ) if form.accepts(request, session, keepvalues=True, formname='make1'): .print form.button.name ?? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: button to start function which dynamicly chynges page
thanks that will give me at least a starting point. Until you wrote I had no idea what I have to look at. I would be interested in your progress if you like to share On Mon, Apr 6, 2015 at 8:06 PM, Dave S snidely@gmail.com wrote: On Monday, April 6, 2015 at 3:16:35 AM UTC-7, BlueShadow wrote: Hi, I have a function in my web2py app which takes quite a while. I like to have a button on a page which starts the funktion but does not reload the page for 10 minutes. The function should also dynamicly display its progress on the page. Is there a way to do that? I would look at using ajax. On the first call, use the scheduler to start the long computation, and the call also sets a cookie, and activates a busy display that uses a timer to make the second call. The second call sees the cookie, checks for results, displays what it can, and if not done repeats the busy/timer activation. I'm interested in using this technique myself, but haven't quite got the js down to do the equivalent of $(document)ready(), but I'm hoping someone can fill in that gap. Dave /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/XasQq3GgrH4/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: AppConfig and Storage
i understood now, thank you so much for detail explaination and reference link, simone. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: call a function from form.process()
a, i understood now, thank you so much for detail explaination, anthony. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] w2p_clone broke web2py installation
please check this : http://www.web2pyslices.com/slice/show/1464/setting-up-web2py-in-a-virtual-environment another thing is if i'm not wrong, web2py version in pip is a little bit late than the github n web2py download web page. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Adding search and insert in text input
i think you can use represent on this e.g. *for reference link :* db.employee.bank.represent = lambda bank, field: \ A(bank.bank, _title=T(eBanking), _target=_blank, _href=%s % bank.ebanking) if bank else '' *for colored value* db.product.status.represent = lambda status, field: SPAN(product_status[status], _class = 'text-success' if status == 'Sold' else 'text-warning' if status == 'Hold' else 'text-error') best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: For a beginner
if you ask flask or web2py in web2py forum, usually, people will answer this is web2py forum, and they will recommend it, but what i see in this forum is the people are quite fair, they gave you comparison, and you choose it yourself. so the point is, if you have a time, just tried both, and ask the community if you have a problem, compare it which is better that can help you when you facing any problem in your code, then choose it. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: update table as boolean.
perhaps you can do it on application form level using onvalidation e.g. def __onvalidation_employee(form): if form.vars.is_auth == 'on': if form.vars.auth_user: row = db(db.auth_user.id == form.vars.auth_user).select().first() form.vars.first_name = row.first_name form.vars.last_name = row.last_name form.vars.email = row.email db(db.auth_user.id == form.vars.auth_user).update(status = T('Permanent') ) else: form.errors.auth_user = T('Enter a value') else: if not form.vars.first_name: form.errors.first_name = T('Enter a value') elif not form.vars.last_name: form.errors.last_name = T('Enter a value') def employee(): grid = SQLFORM.grid(db.employee, onvalidation = __onvalidation_employee) return locals() best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] request table name
You may consider this : http://www.web2pyslices.com/slice/show/1618/basic-usage-statistics-log-what-your-users-do I use this for 3 years and it works great... Richard On Tue, Apr 7, 2015 at 10:45 AM, 黄祥 steve.van.chris...@gmail.com wrote: hi, i want to create a user activity history log, and put it on auth_events. in the description i want to have the table name that interacted with (CUD (Create, Update, Delete) ) e.g. when created new record, i want to have something like this in auth_event description = 'Table Product ID 8 is created' how can i achieve it using web2py way? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Database
Postgres! On Mon, Apr 6, 2015 at 2:00 PM, Philip Kilner phil.kil...@gmail.com wrote: Hi Ron, On 06/04/15 18:38, Ron Chatterjee wrote: Also, open source product wouldn't be as secured as MYSQL since its open source. But I do agree with the rest. I don't agree that open source products are inherently less secure then proprietary ones, but in this case both Postgres and MySQL (and Maria DB) are open source - Oracle may play a little fast and loose with it, but the sources are still available: - https://dev.mysql.com/doc/refman/5.1/en/source-installation.html HTH -- Regards, PhilK 'a bell is a cup...until it is struck' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] AppConfig and Storage
On 4 Apr 2015, at 15:01, Niphlod niph...@gmail.com wrote: if you look at the source code, you'll see that it's just an ini parser by default. All that it does is speedup the settings part without users knowing anything about python (think when you finish an app and you deploy it on a system you may not have access to, or if you ship an app to your users) migrate = 1 or True in this case doesn't make a difference, since it's not fetched. However, the migrate implementation takes a truey/falsey value and doesn't do strict type checking, so casting it to int would make it work fine. In case you'd like to pass your own cast function you can. Beware: since it's made for speed, once you take out the reload on the initialization, values will be stored indefinitely as they are fetched the first time. Sorry for late intromission. Is all of this documented in the book? If I got right, this can change the programer’s expectation about when the system parameters will be refreshed. Until now, it was refreshed on each request. Now, If I understood, it just occurs when the server is reloaded. Am I right? — Vinicius. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Trouble uploading file - cannot unlink temp file
Hello all, I've come across a strange issue on my Linux web2py environment: - In a DB table, I have a field image that is defined like this: Field(image, upload, autodelete=True, label=Image) - When I try to upload an image via a SQLFORM.grid() / Add New Row / Submit (or Edit Row / Submit), I run into an internal error: *Traceback:* Traceback (most recent call last): File /home/www-data/web2py_test/gluon/main.py, line 454, in wsgibase request.body.close() File /usr/lib/python2.7/tempfile.py, line 410, in close self.unlink(self.name) OSError: [Errno 2] No such file or directory: '/tmp/tmpK6hpxp' *Variables:*selfclosed file 'fdopen', mode 'w+b'self.name '/tmp/tmpK6hpxp'self.unlinkbuilt-in function unlink - There is no file /tmp/tmpK6hpxp but I do see the file I uploaded has actually been uploaded successfully to my uploads/ folder. - The size of the file I try to upload doesn't seem to matter - the issue happens for a 1KB as well for 1MB file. - I'm running web2py 2.9.11 with nginx + uwsgi on Ubuntu 12.04. - The issue doesn't occur in Windows (obviously, because _TemporaryFileWrapper().doesn't try to unlink the file for os.name == 'nt'). I couldn't really find any related topics and cannot really make sense of the error message. Maybe something in the uwsgi/nginx config? Any ideas where to look would be greatly appreciated. Thanks, Tobias -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] w2p_clone broke web2py installation
On 7 Apr 2015, at 01:57, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 05/04/15 21:23, Gary Cowell ha scritto: why not just clone the latest version from github and eventually choose a stable tagged version after by doing: $ git checkout tags/anytag That’s exactly what I usually do. The problem is: we don’t have the “stable branch” concept. So, I: - choose a version; - checkout its tag; - make my local tests; - deploy using this tag with checkout. BTW, I’m using the sequential [0] versioning method in my systems with great success. [0] https://docs.djangoproject.com/en/1.7/internals/release-process/#official-releases — Vinicius -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Using ajax to call a function that uses LOAD, not working
default.py @auth.requires_login() def load_home(): loader = $('#right-side').html(i style='font-size:24px;' class='fa fa-spinner fa-spin'/i) websocket_send('http://127.0.0.1:', loader, 'mykey', 'home%s' % auth.user.id) remove_class1 = $('#bk').removeClass('active') #books remove_class2 = $('#ls').removeClass('active') #lecture slides remove_class3 = $('#pq').removeClass('active') #past questions remove_class4 = $('#cs').removeClass('active') #courses remove_class5 = $('#bl').removeClass('active') #blogs remove_class6 = $('#nt').removeClass('active') #notes remove_class7 = $('#fr').removeClass('active') #friends add_class = $('#hm').addClass('active') #home websocket_send('http://127.0.0.1:', remove_class1, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class2, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class3, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class4, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class5, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class6, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', remove_class7, 'mykey', 'home%s' % auth.user.id) websocket_send('http://127.0.0.1:', add_class, 'mykey', 'home%s' % auth.user.id) message = section class='content'br/div class='row'div class='col-md-4'div class='grid box-profile bg-red'div class='grid-body'img src='%s' class='img-circle' alt='User Profile'h3%s/h3spanLorem ipsum dolor sit amet consectetur adipisicing elit sed do eiusmod/span/divdiv class='footer clearfix bg-red'div class='col-xs-4'div class='grid-body full'h3i class='fa fa-facebook-square'/i 823k/h3/div/divdiv class='col-xs-4'div class='grid-body full'h3i class='fa fa-twitter'/i 402k/h3/div/divdiv class='col-xs-4'div class='grid-body full'h3i class='fa fa-linkedin-square'/i 97k/h3/div/div/div/div/div div class='col-md-8 pull-right'div class='grid'div class='grid-header'img style='height:30px;' src='%s' class='img-polaroid pull-left' alt='User Profile'span class='grid-title'Status/span/divdiv class='grid-body' id='sf'/div/div/div/div/section % (URL('download', args=[auth.user.profile_picture]) if auth.user.profile_picture else ../static/nb/html/assets/img/logo.png, auth.user.full_name, URL('download', args=[auth.user.profile_picture]) if auth.user.profile_picture else ../static/nb/html/assets/img/logo.png) message = message.strip().replace(', '') message = message.strip().replace(\n, ) message = message.strip().replace(\r, ) message = message.strip().replace(\t, ) message = $('#right-side').html($('%s').fadeIn('slow').slideDown('slow')) % message websocket_send('http://127.0.0.1:', message, 'mykey', 'home%s' % auth.user.id) form = LOAD(c='default', f='statusform', ajax=True, content=XML('i style=font-size:24px; class=fa fa-cog fa-spin/i')) form = $('#sf').html($('%s').fadeIn('slow').slideDown('slow')) % form websocket_send('http://127.0.0.1:', form, 'mykey', 'home%s' % auth.user.id) def statusform(): status = crud.create(db.statuses) msg = status.element('textarea', _name=status) msg['_class'] = form-control msg['_style'] = height: 40px; width:45vw; margin-bottom:5px; user_id = status.element('input', _name='user_id') user_id['_type'] = 'hidden' user_id['_value'] = auth.user.id submit = status.element('input', _type=submit) submit['_class'] = btn btn-primary pull-right submit['_value'] = Post if status.process().accepted: userPic=db(db.auth_user.id==request.post_vars.user_id).select().first().profile_picture now = prettydate(datetime.datetime.now()) message1 = div class=col-md-8 pull-right style=width:51.9vw;div class=griddiv class=grid-headerimg style=height:30px; width: 30px; src=%s class=img-polaroid pull-left alt=User Profilespan class=grid-title%s/spandiv class=pull-right grid-toolsa data-widget=collapse title=Collapse%s/a/div/divdiv class=grid-body%s/div/div/div % (URL('download', args=[userPic]) if userPic else ../static/nb/html/assets/img/logo.png, db(db.auth_user.id == request.post_vars.user_id).select().first().full_name, now, request.post_vars.status) message1 = message1.strip().replace(\n, br/) message1 = message1.strip().replace(\r, ) script1 = $('#statuses1').prepend($('%s').fadeIn('slow').slideDown('slow')) % message1 script2 = $('#statuses1').show('slow') message2 = div class=col-md-8 pull-right style=width:95vw;div class=griddiv class=grid-headerimg style=height:30px; width: 30px; src=%s class=img-polaroid pull-left alt=User Profilespan class=grid-title%s/spandiv class=pull-right grid-toolsa data-widget=collapse title=Collapse%s/a/div/divdiv
[web2py] Re: Get All Controller Functions
https://github.com/web2py/web2py/blob/master/applications/admin/controllers/default.py#L1062 On Tuesday, April 7, 2015 at 10:01:19 AM UTC-4, Ruud Schroen wrote: What part of the admin creates the list of controllers? I looked in default.py but i couldn't find it.. :( On Monday, March 19, 2012 at 11:16:45 AM UTC+1, Hassan Alnatour wrote: Dear ALL , How Can I Get ALL controller functions , as i know i can get the one am at in the view using request.function , so how can i get all of them ?? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] request table name
i've already read it before, what i want to achieve is get the table name for every database table interaction and put it on auth_event. already checked in documentation about request but couldn't find it. already checked from response.toolbar() too but still can't find it. ref : http://web2py.com/books/default/chapter/29/04/the-core#request best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: post does not appear in this forum, why ?
Yes, this group is moderated so new members messages have to be approved. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Format option in extra_fields
Hi! I'm trying to do something like the code below, but it prompts me the following error : 'SyntaxError: invalid syntax' auth.settings.extra_fields['auth_user']= [Field('Supervisor', 'reference auth_user'), format = '%(db.auth_user.first_name)s %(db.auth_user.last_name)s'] What am I missing here? Cheers, Carla -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Triggering a one-time migration when schema changes
Our team is maintaining table schemas in db.py and relying on the migration mechanism to update the database schema in all of our server/local environments. We have found, however, that we experience a noticeable performance penalty when migrations are enabled and the schema comparison process runs regularly during system usage. Ideally, we would like to trigger migrations to happen only once after a schema change. We have implemented a strategy that seems to be working well. But, we would be interested in whether there are some potential problems we haven't anticipated; or, whether there is a superior method that others have devised. Our strategy was inspired by a comment by Massimo in this discussion thread: Best way to toggle db migration on production server? https://groups.google.com/forum/#!searchin/web2py/db$20migration$20production$20server/web2py/ltnGIhTrq6Q/kJR_B_ybnmcJ We store a database version time stamp in a file and compare it with the modified date for db.py. If db.py is more recent, we toggle migrations on. The database version file is then updated with the new date. Here our code (in db.py) for getting the modified date for db.py and toggling migrations: last_schema_update_time = os.path.getmtime(__file__) current_schema_version_time = datetime.fromtimestamp(last_schema_update_time) migration_needed = migration_needed(current_schema_version_time) db = DAL('{database instance}',decode_credentials=True, pool_size=10, *migrate_enabled**=migration_needed*, fake_migrate = False) The migration_needed function compares the given time (i.e. the modifed date for db.py) with the time stored in the database version file: def migration_needed(current_schema_version_time): migration_needed = False if os.path.exists(version_file_name()): try: with open (version_file_name(), 'r') as version_file: deployed_version = version_file.read() deployed_version_time = datetime.strptime(deployed_version, version_time_format) if deployed_version_time current_schema_version_time: migration_needed = True except: migration_needed = True else: migration_needed = True return migration_needed At the end of db.py, we update the database version file: set_deployed_version(current_schema_version_time) And, here is that function: def set_deployed_version(current_schema_version_time): with open(version_file_name(), 'w') as version_file: version_file.write(current_schema_version_time.strftime(version_time_format)); For completeness, here is our version_file_name() function which causes the database version file to be managed in the databases folder: def version_file_name(): model_dir = os.path.dirname(os.path.abspath(__file__)) databases_dir = os.path.join(model_dir,'../databases') version_file_name = os.path.join(databases_dir, 'db_version') return version_file_name Please share with us your thoughts on this strategy and whether there may be a superior way to accomplish this. Many thanks! Kevin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Am I correct that the | operator has multiple meanings
For queries the | means or: rows = db((db.person.name=='Alex') | (db.person.id3)).select() ↖ here it is an or You can sort the records according to multiple fields by concatenating them with a |: for row in db().select( db.person.ALL, orderby=db.person.name|db.person.id): ↖ here it| concatinates multiple fields -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: How to implement Gmail Authentication
Hello, Still waiting for a working example of OAuth2 with Google. It is very crucial for my application to integrate Google authentication in order to succeed. Hope this great community won't let me down. Thanks and regards. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Design flaw in auth.impersonate ?
Presuming the session is cookie based, why not impersonate in incognito mode or in another browser? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Get All Controller Functions
What part of the admin creates the list of controllers? I looked in default.py but i couldn't find it.. :( On Monday, March 19, 2012 at 11:16:45 AM UTC+1, Hassan Alnatour wrote: Dear ALL , How Can I Get ALL controller functions , as i know i can get the one am at in the view using request.function , so how can i get all of them ?? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Am I correct that the | operator has multiple meanings
Yes, the function of the | operator depends on the objects to which it is being applied. In the first case, it is applied to two Query objects, so it functions as an OR operator (details depend on the database adapter). In the second case, it is applied to two Field objects (a subclass of Expression), so it functions as a separator for orderby lists (which is a comma in most cases, though a + in CouchDB). Anthony On Tuesday, April 7, 2015 at 10:01:19 AM UTC-4, Paul McDonald wrote: For queries the | means or: rows = db((db.person.name=='Alex') | (db.person.id3)).select() ↖ here it is an or You can sort the records according to multiple fields by concatenating them with a |: for row in db().select( db.person.ALL, orderby=db.person.name|db.person.id): ↖ here it| concatinates multiple fields -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Format option in extra_fields
i think the format already define it on auth.define_tables perhaps you can just do the extra fields, not the format. ref: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] AppConfig and Storage
not yet, already checked in : http://web2py.com/books/default/search/29?search=appconfig.ini if i'm not wrong in another threads, massimo told that the documentation will be updated on summer, hope this thing is included too. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] request table name
hi, i want to create a user activity history log, and put it on auth_events. in the description i want to have the table name that interacted with (CUD (Create, Update, Delete) ) e.g. when created new record, i want to have something like this in auth_event description = 'Table Product ID 8 is created' how can i achieve it using web2py way? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Last version of plugin_wiki?
Hi guys, where can I get the latest version of plugin_wiki? Best, K -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Simple routing question
it is working. Pythonanywhere.com folks were really helpful. There was so much trial and error I don't which of the below processes was responsible for success and what might be inefficient. Put routes.py under web2py main directory: / home alexglaros web2py routes.pyNOT UNDER YOUR SPECIFIC APP LIKE THIS: / home alexglaros web2py applications engagementsquared routes.py #!/usr/bin/python # -*- codingf-8 -*- routers = dict( # base router BASE=dict( default_application='engagementsquared', domains={'www.engagementsquared.com':'engagementsquared'} ), ) create this file according to their website directions: WSGI configuration file: /var/www/www_engagementsquared_com_wsgi.py https://www.pythonanywhere.com/user/alexglaros/files/var/www/www_engagementsquared_com_wsgi.py?edit import os import sys # add your project directory to the sys.path project_home = u'/home/alexglaros/web2py/' if project_home not in sys.path: sys.path = [project_home] + sys.path sys.stdout = sys.stderr os.chdir(project_home) # serve web2py via WSGI handler from gluon.main import wsgibase as application At hostmonster.com, here is advice from pythonanywhere.com support: PythonAnywhere web apps for specific domains. If you go to www.engagementsquared.com, you'll see a PythonAnywhere coming soon page. This means that you've set up the CNAME for www.engagementsquared.com correctly -- the HTTP redirect problem is only with the version without the www. But you only have a web up set up on PythonAnywhere for alexglaros.pythonanywhere.com. This page explains how to set things up so that you can serve an existing web app on a new domain: https://www.pythonanywhere.com/wiki/UsingANewDomainForExistingWebApp Did above,then back at pythonanywhere.com site was careful to choose manual configuration, not create a new Web2py app. Easy to miss that. So even though I had an app running, I still had to choose Add a new app. Finally, hit the reload app button and instant success. Both stripped URL engagementsquared.com and with a www www.engagmentsquared.com work. Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] AppConfig and Storage
Sorry for late intromission. Is all of this documented in the book? If I got right, this can change the programer’s expectation about when the system parameters will be refreshed. that's why the scaffolding has reload=True, with a comment to remove that parameter once in production. Until now, it was refreshed on each request. Now, If I understood, it just occurs when the server is reloaded. Let's don't fall in shortcircuits: until now, there was no such thing as appconfig. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] request table name
basically i've already create a function for it, either put it on form level or database level, but the problem is i can't get the table name to put it on auth_event table (description field). *e.g. event recorded on form level* def oncreate_event(form): db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request.function), description = 'ID %s created' % (form.vars.id) ) *e.g. event recorded on database level with after_insert callback* def after_insert_event(f, id): db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request.function), description = 'ID %s created' % (id) ) so perhaps there is a way in web2py to achieve it, i want to know about it. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] request table name
If it is not in args or vars, I guess you can't have it!! At least from the URL... You better look from backend side for this, postgres log for instance... Richard On Tue, Apr 7, 2015 at 11:12 AM, 黄祥 steve.van.chris...@gmail.com wrote: i've already read it before, what i want to achieve is get the table name for every database table interaction and put it on auth_event. already checked in documentation about request but couldn't find it. already checked from response.toolbar() too but still can't find it. ref : http://web2py.com/books/default/chapter/29/04/the-core#request best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Triggering a one-time migration when schema changes
don't ever set migrate=True if not on the development server. When you need it, set migrate=True, hit appadmin one time to let the migration happen, then set it to False. No need to waste CPU or I/O if you're in complete control of when migrations need to happen. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: button to start function which dynamicly chynges page
On Tuesday, April 7, 2015 at 3:11:51 AM UTC-7, BlueShadow wrote: thanks that will give me at least a starting point. Until you wrote I had no idea what I have to look at. I would be interested in your progress if you like to share I've posted my single-pass ajax sample recently (20s per load), and the archives have several other people's examples, but I haven't got far in the multi-pass version yet. /dps On Mon, Apr 6, 2015 at 8:06 PM, Dave S snide...@gmail.com javascript: wrote: On Monday, April 6, 2015 at 3:16:35 AM UTC-7, BlueShadow wrote: Hi, I have a function in my web2py app which takes quite a while. I like to have a button on a page which starts the funktion but does not reload the page for 10 minutes. The function should also dynamicly display its progress on the page. Is there a way to do that? I would look at using ajax. On the first call, use the scheduler to start the long computation, and the call also sets a cookie, and activates a busy display that uses a timer to make the second call. The second call sees the cookie, checks for results, displays what it can, and if not done repeats the busy/timer activation. I'm interested in using this technique myself, but haven't quite got the js down to do the equivalent of $(document)ready(), but I'm hoping someone can fill in that gap. Dave /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/XasQq3GgrH4/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] request table name
In a model, after all tables have been defined, you could do something like this: from functools import partial def after_insert_event(f, id, table): db.auth_event.insert(time_stamp = request.now, client_ip = request. client, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request. function), description = 'ID %s created in table %s' % (id, table)) for table in db.tables: db[table]._after_insert.append(partial(after_insert_event, table=table)) You could do something for _after_update and _after_delete, though keep in mind that those operations can affect more than one record, so there won't necessarily be just a single record ID to record. Anthony On Tuesday, April 7, 2015 at 12:10:26 PM UTC-4, 黄祥 wrote: basically i've already create a function for it, either put it on form level or database level, but the problem is i can't get the table name to put it on auth_event table (description field). *e.g. event recorded on form level* def oncreate_event(form): db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request.function), description = 'ID %s created' % (form.vars.id) ) *e.g. event recorded on database level with after_insert callback* def after_insert_event(f, id): db.auth_event.insert(time_stamp = request.now, client_ip = request.client, user_id = auth.user_id, origin = '%s/%s' % (request.controller, request.function), description = 'ID %s created' % (id) ) so perhaps there is a way in web2py to achieve it, i want to know about it. thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: post does not appear in this forum, why ?
On Tuesday, April 7, 2015 at 6:45:44 AM UTC-7, Leonel Câmara wrote: Yes, this group is moderated so new members messages have to be approved. And the moderators are volunteers, AIUI, so sometimes delays happen in popping items off the queue. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Simple routing question
That was it, I forgot about the wsgi file update. That was the part I was missing as well that the pythonanywhere folks helped with. And yes, they were pleasant to work with and had the answers. On Tue, Apr 7, 2015 at 11:45 AM, Alex Glaros alexgla...@gmail.com wrote: it is working. Pythonanywhere.com folks were really helpful. There was so much trial and error I don't which of the below processes was responsible for success and what might be inefficient. Put routes.py under web2py main directory: / home alexglaros web2py routes.pyNOT UNDER YOUR SPECIFIC APP LIKE THIS: / home alexglaros web2py applications engagementsquared routes.py #!/usr/bin/python # -*- codingf-8 -*- routers = dict( # base router BASE=dict( default_application='engagementsquared', domains={'www.engagementsquared.com':'engagementsquared'} ), ) create this file according to their website directions: WSGI configuration file: /var/www/www_engagementsquared_com_wsgi.py https://www.pythonanywhere.com/user/alexglaros/files/var/www/www_engagementsquared_com_wsgi.py?edit import os import sys # add your project directory to the sys.path project_home = u'/home/alexglaros/web2py/' if project_home not in sys.path: sys.path = [project_home] + sys.path sys.stdout = sys.stderr os.chdir(project_home) # serve web2py via WSGI handler from gluon.main import wsgibase as application At hostmonster.com, here is advice from pythonanywhere.com support: PythonAnywhere web apps for specific domains. If you go to www.engagementsquared.com, you'll see a PythonAnywhere coming soon page. This means that you've set up the CNAME for www.engagementsquared.com correctly -- the HTTP redirect problem is only with the version without the www. But you only have a web up set up on PythonAnywhere for alexglaros.pythonanywhere.com. This page explains how to set things up so that you can serve an existing web app on a new domain: https://www.pythonanywhere.com/wiki/UsingANewDomainForExistingWebApp Did above,then back at pythonanywhere.com site was careful to choose manual configuration, not create a new Web2py app. Easy to miss that. So even though I had an app running, I still had to choose Add a new app. Finally, hit the reload app button and instant success. Both stripped URL engagementsquared.com and with a www www.engagmentsquared.com work. Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/2aAx3-6EOq8/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: web2py 2.10.3 si OUT
I too am having this issue with 2.10.3 -Jim On Monday, April 6, 2015 at 12:26:28 AM UTC-5, 黄祥 wrote: format record representation is not work in grid (in the drop down select form field is work, but in the grid table just shown an id). e.g. db.define_table('test0', Field('test0'), format = '%(test0)s') db.define_table('test1', Field('test0', 'reference test0'), Field('test1'), format = '%(test1)s') def test0(): grid = SQLFORM.grid(db.test0) return locals() def test1(): grid = SQLFORM.grid(db.test1) return locals() best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Please report here upgrading issues to web2py 2.10.2
Just wondering if this is posted in the right place. Should I be reporting this issue elsewhere? -Jim On Monday, April 6, 2015 at 9:53:46 AM UTC-5, Jim S wrote: Upgraded to 2.10.3-stable+timestamp.2015.04.02.21.42.07 (Running on nginx/1.4.6, Python 2.7.6) ...still having the same problem with record versioning. -Jim On Thursday, April 2, 2015 at 4:37:03 PM UTC-5, Jim S wrote: Version 2.10.1-stable+timestamp.2015.04.01.03.27.40 I have one table with record versioning turned on. I get the following in my nginx setup... nginx 502 Bad Gateway Looking in the nginx log I see: 2015/04/02 15:37:13 [error] 1040#0: *67 upstream prematurely closed connection while reading response header from upstream, client: 10.10.2.126, server: ss15, request: POST /contacts/index/edit/contact/5221?district_id=0search_text=steiltag_id=0_signature=81d4b0ab8a5bf5f05de6ed17c6203596d5883f76 HTTP/1.1, upstream: uwsgi://unix:///tmp/web2py.socket:, host: ss15, referrer: https://ss15/contacts/index/edit/contact/5221?district_id=0search_text=steiltag_id=0_signature=81d4b0ab8a5bf5f05de6ed17c6203596d5883f76 If I comment out this line: db.contact._enable_record_versioning() Then it works fine. It works fine on my production server running Version 2.9.5-stable+timestamp.2014.03.16.02.35.39 nginx 1.4.6 on both systems uwsgi version 2.0.6 on the system that works uwsgi version 2.0.10 on the system exhibiting the problem If I run with the built-in rocket server, I see the same behavior. Here is the traceback when running on rocket: ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last): File C:\prod\web2py\gluon\rocket.py, line 1337, in run self.run_app(conn) File C:\prod\web2py\gluon\rocket.py, line 1838, in run_app output = self.app(environ, self.start_response) File C:\prod\web2py\gluon\main.py, line 652, in app_with_logging ret[0] = wsgiapp(environ, responder2) File C:\prod\web2py\gluon\main.py, line 563, in wsgibase return wsgibase(new_environ, responder) File C:\prod\web2py\gluon\main.py, line 533, in wsgibase if request.body: File C:\prod\web2py\gluon\globals.py, line 268, in body self._body = copystream_progress(self) File C:\prod\web2py\gluon\globals.py, line 125, in copystream_progress copystream(source, dest, size, chunk_size) File C:\prod\web2py\gluon\fileutils.py, line 426, in copystream data = src.read(size) ValueError: I/O operation on closed file Please let me know if you need more information to help with this issue. -Jim On Wednesday, April 1, 2015 at 11:03:20 AM UTC-5, Massimo Di Pierro wrote: Please report here upgrading issues to web2py 2.10.2 from which version? which os? which python version? what is the problem? complete traceback -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Simple routing question
May be we can add a tag to this as how to deploy in python anywhere. On Tuesday, April 7, 2015 at 12:45:57 PM UTC-4, Alex Glaros wrote: it is working. Pythonanywhere.com folks were really helpful. There was so much trial and error I don't which of the below processes was responsible for success and what might be inefficient. Put routes.py under web2py main directory: / home alexglaros web2py routes.pyNOT UNDER YOUR SPECIFIC APP LIKE THIS: / home alexglaros web2py applications engagementsquared routes.py #!/usr/bin/python # -*- codingf-8 -*- routers = dict( # base router BASE=dict( default_application='engagementsquared', domains={'www.engagementsquared.com':'engagementsquared'} ), ) create this file according to pythonanywhere.com's website directions: WSGI configuration file: /var/www/www_engagementsquared_com_wsgi.py import os import sys # add your project directory to the sys.path project_home = u'/home/alexglaros/web2py/' if project_home not in sys.path: sys.path = [project_home] + sys.path sys.stdout = sys.stderr os.chdir(project_home) # serve web2py via WSGI handler from gluon.main import wsgibase as application At hostmonster.com, here is advice from pythonanywhere.com support: PythonAnywhere web apps for specific domains. If you go to www.engagementsquared.com, you'll see a PythonAnywhere coming soon page. This means that you've set up the CNAME for www.engagementsquared.com correctly -- the HTTP redirect problem is only with the version without the www. But you only have a web up set up on PythonAnywhere for alexglaros.pythonanywhere.com. This page explains how to set things up so that you can serve an existing web app on a new domain: https://www.pythonanywhere.com/wiki/UsingANewDomainForExistingWebApp Did above,then back at pythonanywhere.com site was careful to choose manual configuration, not create a new Web2py app. Easy to miss that. So even though I had an app running, I still had to choose Add a new app. Finally, hit the reload app button and instant success. Both stripped URL engagementsquared.com and with a www www.engagmentsquared.com work. Alex -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Triggering a one-time migration when schema changes
El martes, 7 de abril de 2015, 17:53:14 (UTC+2), Niphlod escribió: When you need it, set migrate=True, hit appadmin one time to let the migration happen, then set it to False. How about using python web2py.py -S your_app -M instead of hitting appadmin? The reason is that I disable the app while upgrading, and the above command triggers the migration even with the app in maintenance. Niphlod, what would happen if you get a request for your app after you have upgraded the code but before you hit appadmin? Is an error ticket the worst-case scenario? I use a procedure very similar to Kevin, I guess I read the same thread! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.