[web2py] An error occured, please reload the page
After upgrading to web2py version 2.10.4 I sometimes get a flash message: An error occured, please reload the page This also happens when editing the appconfig.ini file, even though the appconfig.ini file does not contain an error. Since the message doesn't give me any information as to why the error occured, and which file contains the error, I don't see the point of this flash message. What is the use of this message? Kind regards, Annet -- 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] Python not responding on Mac OS X Mavericks
I run web2py 2.10.4 on OS X Mavericks. I always have several (4 to 6) Firefox windows open to edit files in web2py, in previous versions of web2py this wasn't a problem, however, in version 2.10.4, the more windows I edit files in the more cpu python uses and the slower it becomes, until it's no longer responding. Is there a way to fix this issue? Kind regards, Annet -- 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: An error occured, please reload the page
That is handled here https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L240in web2py.js (the error message itself is set in web2py_ajax.html https://github.com/web2py/web2py/blob/master/applications/welcome/views/web2py_ajax.html#L7, though web2py.js does not provide a default value in case web2py_ajax.html is not included in the page). If you don't want to edit web2py.js, I think you can add this to your layout (or wherever on the parent page): script $(function() { $(document).off('ajaxError'); }); /script Of course, that will cancel any other previously defined ajaxError handlers as well (e.g., if you are using some third party library that adds this handler). Alternatively, you could add your own handler to hide the flash div. Anyway, this message should probably be optional or configurable -- maybe submit a github issue requesting that. Anthony On Sunday, July 19, 2015 at 6:40:53 AM UTC-4, Annet wrote: After upgrading to web2py version 2.10.4 I sometimes get a flash message: An error occured, please reload the page This also happens when editing the appconfig.ini file, even though the appconfig.ini file does not contain an error. Since the message doesn't give me any information as to why the error occured, and which file contains the error, I don't see the point of this flash message. What is the use of this message? Kind regards, Annet -- 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: An error occured, please reload the page
Another hack is to do: script ajax_error_500 = undefined; /script That will cause the code in web2py.js to fail, which will prevent the flash message from appearing. Anthony On Sunday, July 19, 2015 at 9:10:56 AM UTC-4, Anthony wrote: That is handled here https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L240in web2py.js (the error message itself is set in web2py_ajax.html https://github.com/web2py/web2py/blob/master/applications/welcome/views/web2py_ajax.html#L7, though web2py.js does not provide a default value in case web2py_ajax.html is not included in the page). If you don't want to edit web2py.js, I think you can add this to your layout (or wherever on the parent page): script $(function() { $(document).off('ajaxError'); }); /script Of course, that will cancel any other previously defined ajaxError handlers as well (e.g., if you are using some third party library that adds this handler). Alternatively, you could add your own handler to hide the flash div. Anyway, this message should probably be optional or configurable -- maybe submit a github issue requesting that. Anthony On Sunday, July 19, 2015 at 6:40:53 AM UTC-4, Annet wrote: After upgrading to web2py version 2.10.4 I sometimes get a flash message: An error occured, please reload the page This also happens when editing the appconfig.ini file, even though the appconfig.ini file does not contain an error. Since the message doesn't give me any information as to why the error occured, and which file contains the error, I don't see the point of this flash message. What is the use of this message? Kind regards, Annet -- 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] Display uploaded image only if it exists
My model includes an optional image upload: db.define_table('adult', Field('staff_id', type='integer', label=T('Staff ID')), Field('thumbnail', type='upload', label=T('Photo')), In the view I want to display the image if it exists, but hide it if null: {{=form.custom.begin}} {{if adult.thumbnail:}} div style=float: right; class=thumbnail {{=form.custom.widget.thumbnail}} /div {{pass}} ... Where the image exists, it displays correctly. However, where no image has been uploaded the view displays the text 'file'. How do I stop this - I have tried a variety of if statements in the view but without success. Any pointers appreciated, Andy -- 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 edit response.generic_patterns code
I make new app and some controller in it without any view - only generic.html than I try open url to that coontroller from public - error rised Not found so I need to search WHY? one day I lose for solve WHY? may be open access to generic.html by default? вторник, 14 июля 2015 г., 21:01:21 UTC+3 пользователь Dave S написал: On Tuesday, July 14, 2015 at 9:41:29 AM UTC-7, ermolaev...@gmail.com wrote: I make simple app and upload it to server then all external request raise Not Found :( I kill a day for solve it problem Please edit in menu.py code: response.generic_patterns = ['*'] if request.is_local else [] #IS_LOCAL = request.is_local response.generic_patterns = not IS_LOCAL and (request.aplication == 'admin' or request.controller == 'appadmin') and [] or ['*'] Isn't that a security feature? Generic views are restricted to local use for debuging (they expose a lot of stuff the user doesn't need). The admin functions are also restricted to local or https, to limit the number of people trying to crack the password. Did you implement a specific view for your controller functions? /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.
[web2py] web2py on bluehost shared server
Hello guys, I am very new to server deployment, But i have my web2py app completely ready in my local server and for testing purpose i have bought a shared server on bluehost.com but i have no clue about how to deploy my app there. Can i simply put the web2py package directly into the public_html folder and run web2py.py on the server or i need to install some other version of web2py for CloudLinux.Please help.. -- 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: Importing Data / Force Record ID #s To Remain As Specified in the CSV
Massimo, It's doesn't works for me. I have two columns: tbState.id and tbState.Name . I need to keep this id because i am using it in another table. i'm using the following code in shell tool: db.tbState.import_from_csv_file(open('db_tbState.csv'), map = {}) Thaks On Thursday, January 23, 2014 at 2:39:51 PM UTC-3, Mark Billion wrote: I know that this is a dumb question, but I have a database with static data entry ids 17 to 100. When I download the CSV, it has the x.id field and the corresponding number. However, when I create a new database and upload the data using the db admin, it automatically renumbers these entries. Because its static, I have been referencing it by id -- so renumbering throws this off. Anything I can do? -- 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: SQLFORM grid bug is demonstrated in the attached app
If I do have an Add button but I add the folowing after the grid creation: grid = SQLFORM.grid(db.place) for a in grid.elements('input',_name='mode'):# disable mode change. can be done on a separate form a['_disabled']='' to manipulate the html so the radio button will be disable on the edit/new forms, then I can't add new records I get the new record form but clicking on submit the form stays and a record is not added. When you disable an HTML form input, the browser does not submit any value for that input (even if a value is selected, as in this case). As a result, the SQLFORM processing ends up setting the value to an empty string, which causes the default IS_IN_DB validator on the reference field to return an error complaining that the value is not in the database. To avoid this problem, you can add the default value to request.post_vars before the grid is called: if 'new' in request.args and request.post_vars: request.post_vars.mode = 1 Include that before calling SQLFORM.grid. I have also another issue (now that I have your attention:): Some times in my development process the session.flash functionality changed so the flash message blinks a few times and disappears. Only a thin line is left in the color of the flash window. If I click on it it vanished exactly like the flash window. Something similar is happening also to errors on a form if I don't fill a field that is required then the red error message blinks a few times and disappears. I get it all over the app also in the login dialog, the e-mail requires blinks and vanished. If I click the login button a few times the error message eventually stays.. No idea about that -- I've never seen it nor heard anyone else report that behavior. Anthony -- 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: logout other user
cycle the sessions and delete the ones whose users you'd like to block in a separate process, or implement your own blockage in a model that gets checked at every request. The possibility to block a session while it's logged in would probably never implemented in the core because of the severe performance hits associated to check for every request if the user is allowed to log in. On Sunday, July 19, 2015 at 9:11:14 PM UTC+2, Alex wrote: Is it possible to logout other users which are currently logged in? I want to temporarly block certain users. I can set the registration_key to 'disabled' so they cannot login anymore. But if a user is already logged in I'd need to delete the session file for this user so he gets automatically logged out. 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: Field('upload') : problem with file name
This is not only an issue with Windows; any filesystem with a filename limit (however big) can hit this problem. As this is all being handled by web2py, and the user is selecting the file to upload, where would this logic go, and why isn't web2py handling it? - Scott On Saturday, March 16, 2013 at 1:04:28 PM UTC-4, Niphlod wrote: I was wrong. the first part of the hash is a uuid, the second is a base16 encoding of the original filename. Seems that you need some logic to cut down long files if you plan to host on Windows. http://web2py.com/books/default/chapter/29/07?search=uploads#Storing-the-original-filename http://www.google.com/url?q=http%3A%2F%2Fweb2py.com%2Fbooks%2Fdefault%2Fchapter%2F29%2F07%3Fsearch%3Duploads%23Storing-the-original-filenamesa=Dsntz=1usg=AFQjCNHoAJ_7v4pFTQfLJ7w7itNYEBhoPw -- 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: Multiples ajax forms (with LOAD). It is possible?
Not sure what's going on. I also tried 2.11.2, though on Windows 8.1 x64 with Python 2.7.6. On Sunday, July 19, 2015 at 4:57:48 PM UTC-4, 黄祥 wrote: strange, in my local, the behaviour make me submit twice for the form in first component (web2py source version 2.11.2, python 2.7.8, windows 7 x64), while i test the same app in pythonanywhere, it didn't make me submit twice for the form in first component (same like yours). already remove the old web2py folder with new extracted from web2py_src.zip, but still got the same result. any clue what is the root cause for this? 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: Multiples ajax forms (with LOAD). It is possible?
strange, in my local, the behaviour make me submit twice for the form in first component (web2py source version 2.11.2, python 2.7.8, windows 7 x64), while i test the same app in pythonanywhere, it didn't make me submit twice for the form in first component (same like yours). already remove the old web2py folder with new extracted from web2py_src.zip, but still got the same result. any clue what is the root cause for this? 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: logout other user
Is there a way to get the session filename for a user? I don't think going through all session files will be an option - is it even possible to get the user who belongs to a session file? Checking the blockage on every request also doesn't sound that good. I guess I'll probably check if the user is blocked only on certain operations, e.g. saving certain entries. -- 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 edit response.generic_patterns code
The generic views can result in a security vulnerability because they expose all data returned by the controller. For this reason, they are disabled by default. You should only enable specific generic views in specific cases when you have verified that you are not over-exposing any data. For example, suppose you have written a custom html view and have returned rows from the db.auth_user table to the view in order to list some names. If you have all generic views enabled, someone could visit the URL with a .json or .xml extension, which will trigger the use of a generic view, which will then expose all fields in the db.auth_user data rather then just the names you included in the html view. Anyway, I think all the places in the documentation that mention the generic views include a note explaining that they are disabled by default except on localhost. Anthony On Sunday, July 19, 2015 at 11:10:20 AM UTC-4, ermolaev.icrea...@gmail.com wrote: I make new app and some controller in it without any view - only generic.html than I try open url to that coontroller from public - error rised Not found so I need to search WHY? one day I lose for solve WHY? may be open access to generic.html by default? вторник, 14 июля 2015 г., 21:01:21 UTC+3 пользователь Dave S написал: On Tuesday, July 14, 2015 at 9:41:29 AM UTC-7, ermolaev...@gmail.com wrote: I make simple app and upload it to server then all external request raise Not Found :( I kill a day for solve it problem Please edit in menu.py code: response.generic_patterns = ['*'] if request.is_local else [] #IS_LOCAL = request.is_local response.generic_patterns = not IS_LOCAL and (request.aplication == 'admin' or request.controller == 'appadmin') and [] or ['*'] Isn't that a security feature? Generic views are restricted to local use for debuging (they expose a lot of stuff the user doesn't need). The admin functions are also restricted to local or https, to limit the number of people trying to crack the password. Did you implement a specific view for your controller functions? /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.
[web2py] No Access After Ubuntu Upgrade
all was working as expected on my web2py app then I updated from ubuntu 12.04 to 14.04 now I get { Forbidden You don't have permission to access /omniavx_auden on this server. -- Apache/2.4.7 (Ubuntu) Server at ovxdev.us Port 80 } is there anything within web2py that I need to update when an ubuntu upgrade is done? -- 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: can grid record be displayed vertically?
No built in support for that. You might be able to use CSS/JS to achieve that in the browser. Alternatively, the Rows object from the DAL is stored in grid.rows, so you could use that to build your own display. Anthony On Friday, July 17, 2015 at 6:56:33 PM UTC-4, Alex Glaros wrote: can grid record be displayed vertically? E.g., db.define_table('Preferences', Field('prefer_weekly_digest','boolean'), Field('prefer_no_alerts','boolean'), Field('default_reply_to_friend_requests', 'string')) User sees their preferences in vertical format Weekly Digest ☐ Prefer no alerts ☐ Default reply to friend requests 'Hi, sure I'll connect with you' thanks, Alex Glaros -- 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: Display uploaded image only if it exists
Please show more code (i.e., controller and rest of form in view). What is adult? On Sunday, July 19, 2015 at 9:46:22 AM UTC-4, Andy W wrote: My model includes an optional image upload: db.define_table('adult', Field('staff_id', type='integer', label=T('Staff ID')), Field('thumbnail', type='upload', label=T('Photo')), In the view I want to display the image if it exists, but hide it if null: {{=form.custom.begin}} {{if adult.thumbnail:}} div style=float: right; class=thumbnail {{=form.custom.widget.thumbnail}} /div {{pass}} ... Where the image exists, it displays correctly. However, where no image has been uploaded the view displays the text 'file'. How do I stop this - I have tried a variety of if statements in the view but without success. Any pointers appreciated, Andy -- 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: Multiples ajax forms (with LOAD). It is possible?
Sorry, I can't reproduce the problem with the attached app. When I go to /default/sale_order and select a product (a or b) from the list, set and quantity, and hit Submit, the form submits properly, and the table below is updated via Ajax with the values I submitted. I do not have to submit the form twice. Anthony On Tuesday, July 14, 2015 at 5:51:22 PM UTC-4, 黄祥 wrote: attached the min app that reproduce an error. step i took : clean app (sessions, error, cache) login and then access the sale_order page (which contain the web2py components) problem : SQLFORM.factory in first grid, need submit twice to response (either error or accepted) environment : web2py latest version (source) pardon me, if i asked in irrelevant thread, should i create a new thread for this. 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] Re: Web2py is Badly designed framework and Does not scale
On Sunday, July 19, 2015 at 11:10:19 AM UTC-4, eric cuver wrote: can we use brython with web2py ? Sure. Brython simply generates Javascript code that then gets executed in the browser, so you can use Brython with web2py in the same sense that you can use Javascript with web2py. Anthony -- 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: No Access After Ubuntu Upgrade
I changed Directory / Options FollowSymLinks AllowOverride None Require all denied /Directory to Directory / Options FollowSymLinks AllowOverride None Require all granted /Directory in the file /etc/apache2/apache2.conf seemed to resolve the issue :) On Sunday, July 19, 2015 at 9:38:48 AM UTC-5, Auden RovelleQuartz wrote: all was working as expected on my web2py app then I updated from ubuntu 12.04 to 14.04 now I get { Forbidden You don't have permission to access /omniavx_auden on this server. -- Apache/2.4.7 (Ubuntu) Server at ovxdev.us Port 80 } is there anything within web2py that I need to update when an ubuntu upgrade is done? -- 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
it's a clear separation of code and configuration. When you deploy the application on a server you usually have a different database connection string (and maybe other different settings as well), usually even multiple setups for dev, test and so on. Without a configuration file you'd have to change the source code on the deployed app. Am Sonntag, 19. Juli 2015 17:10:30 UTC+2 schrieb ermolaev...@gmail.com: why it better than code in /models/0.py ? response.db_cs = 'DB_CONN_STR' or DB_SC = 'DB_CONN_STR' четверг, 16 июля 2015 г., 5:29:03 UTC+3 пользователь Alex написал: thanks for the AppConfig implementation! this is really useful and allows easy configuration of db connections. Actually I posted a question about this a few years ago - in the meantime I found a workaround but I'll change it to AppConfig soon. Is this already mentioned in the book somewhere? I couldn't find it. 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: forms
That sounds like the right approach. Maybe you need to tweak the server response code or the JS code that handles the Ajax response. On Sunday, July 19, 2015 at 11:10:19 AM UTC-4, Ramchandra Sharma wrote: I am trying something with form in which on selecting some thing in select tag i should get some data from database based on select tag value.So on select tag i used ajax call but the ajax response text is difficult to parse is there any other way? Thanks in advance :) -- 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: Web2py is Badly designed framework and Does not scale
web2bry! 2015-07-19 17:04 GMT+01:00 Anthony abasta...@gmail.com: On Sunday, July 19, 2015 at 11:10:19 AM UTC-4, eric cuver wrote: can we use brython with web2py ? Sure. Brython simply generates Javascript code that then gets executed in the browser, so you can use Brython with web2py in the same sense that you can use Javascript with web2py. Anthony -- 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] logout other user
Is it possible to logout other users which are currently logged in? I want to temporarly block certain users. I can set the registration_key to 'disabled' so they cannot login anymore. But if a user is already logged in I'd need to delete the session file for this user so he gets automatically logged out. 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: AJAX on click not restore button
Looks like you have specified a relative URL in the ajax() function, which simply gets appended to the URL of the current page, so instead of making the Ajax request to /default/aj1, the request is going to /default/index/aj1. You should use the URL helper instead: ajax('{{=URL('default', 'aj1')}}',[],'t') See if that helps. On Sunday, July 19, 2015 at 11:10:16 AM UTC-4, ermolaev.icrea...@gmail.com wrote: 2.11.2.11.2-stable+timestamp.2015.05.30.16.33.24 (Running on Rocket 1.2.6, Python 2.7.9) please test: # -*- coding: utf-8 -*- from time import sleep def aj1(): session.t = (session.t or 0) + 1 sleep(2) return 'OK %s. Click once more!' % session.t def index(): h = CAT( FORM( BUTTON('Test', _onclick=ajax('aj1',[],'t');$('#t').html('testing...');), _action=javascript: void(0); ), DIV(_id='t'), # target ) return dict(h = DIV(h, _class='container')) when click - button id Working... and not restored (( -- 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: callback in A helper + input vars - how?
Here is an example of how to do it: https://github.com/mdipierro/estore3/blob/master/views/default/index.html#L154 jQuery.web2py.enableElement(form.find('.disabled')); On Friday, 17 July 2015 03:05:15 UTC-5, ermolaev.icrea...@gmail.com wrote: How by using A helper callback sen a data from inputs?? input type=text name=search / {{=A('Search', callback=URL('list', vars={'search'}), target='t', _class='button white-bgc')}} IF do by _onclick=ajax('list',['search], 't') - how disable button and show Working... message in button? -- 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: crash - session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) on 2.9.11
This not work in this case will be work HTTP or HTTPS request only - that will be requested to server first If a first request to the server after restart it was HTTP - then all HTTPS request will raise error If a first request to the server after restart it was HTTPS - then all HTTP request will raise error ((( how solve it?? it will raise error with all PORTs пятница, 16 января 2015 г., 20:54:50 UTC+3 пользователь Leonel Câmara написал: No don't downgrade, delete everything in the sessions and cache folder, clear compiled, and then upgrade. -- 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: logout other user
On Sunday, July 19, 2015 at 5:27:50 PM UTC-4, Alex wrote: Is there a way to get the session filename for a user? I don't think going through all session files will be an option - is it even possible to get the user who belongs to a session file? The session filename is not stored anywhere, so you would have to scan through all the session files and look for auth.user.id in each file. It is certainly possible, though you may want to do it via an asynchronous task rather than within a single HTTP request (though if this is just an occassional admin operation, you might not mind waiting). Checking the blockage on every request also doesn't sound that good. I guess I'll probably check if the user is blocked only on certain operations, e.g. saving certain entries. You could also keep a list of currently blocked users in cache.ram, and when a request comes from a user in that list, (a) log out the user and (b) remove the ID from the cache. Anthony -- 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: logout other user
The possibility to block a session while it's logged in would probably never implemented in the core because of the severe performance hits associated to check for every request if the user is allowed to log in. Maybe upon login (or session renew of a logged in user), store the current session ID in the db.auth_user table. Then if you want to log out a given user, just get the session ID from db.auth_user and delete the session file. Anthony -- 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] AJAX on click not restore button
2.11.2.11.2-stable+timestamp.2015.05.30.16.33.24 (Running on Rocket 1.2.6, Python 2.7.9) please test: # -*- coding: utf-8 -*- from time import sleep def aj1(): session.t = (session.t or 0) + 1 sleep(2) return 'OK %s. Click once more!' % session.t def index(): h = CAT( FORM( BUTTON('Test', _onclick=ajax('aj1',[],'t');$('#t').html('testing...');), _action=javascript: void(0); ), DIV(_id='t'), # target ) return dict(h = DIV(h, _class='container')) when click - button id Working... and not restored (( -- 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: SQLFORM grid bug is demonstrated in the attached app
Thanks Antony This did the trick, I think it is a serious bug (.. but all bugs are serious:-) Regarding the Add button, I removed the authentication to make it simpler for testers to see the bug. I do have it in my app. Now we can move to the next bug: If I do have an Add button but I add the folowing after the grid creation: grid = SQLFORM.grid(db.place) for a in grid.elements('input',_name='mode'):# disable mode change. can be done on a separate form a['_disabled']='' to manipulate the html so the radio button will be disable on the edit/new forms, then I can't add new records I get the new record form but clicking on submit the form stays and a record is not added. I do it because I don't want the user to set the place mode on the edit form but to use a form specifically for that I have also another issue (now that I have your attention:): Some times in my development process the session.flash functionality changed so the flash message blinks a few times and disappears. Only a thin line is left in the color of the flash window. If I click on it it vanished exactly like the flash window. Something similar is happening also to errors on a form if I don't fill a field that is required then the red error message blinks a few times and disappears. I get it all over the app also in the login dialog, the e-mail requires blinks and vanished. If I click the login button a few times the error message eventually stays.. ( this issue is no demonstrated in the app i attached) Could you please point me to the right direction ? Thanks On Friday, July 17, 2015 at 10:48:46 PM UTC+2, Anthony wrote: For now, one workaround might be to do this right before defining the grid: db.place.mode.type = 'integer' In that case, because the grid won't think the field is a reference field, it will not attempt to cache the output of the represent function. Also, you probably don't see an Add button because you are not logged in (login is required, unless you set user_signature=False, which is not recommended). Anthony On Friday, July 17, 2015 at 4:38:05 PM UTC-4, Anthony wrote: You have found a bug, which I have submitted here: https://github.com/web2py/web2py/issues/1024 Thanks for putting this together. Anthony On Friday, July 17, 2015 at 1:53:36 PM UTC-4, icodk wrote: The attached app is a simple two tables app that demonstrates smart/grid bug in represent settings: the line : db.place.mode.represent=lambda mode,row: A(T(db.place_mode[mode].name), _href=URL('place_mode_change',args=row.id)) should generate a link with specific row.id for each row. However, if the text(in this case the mode db.place_mode[mode].name) is the same for more then one row, the row.id will not be updated. In addition, the Add Record button is missing for no obvious(for me ) reason 2.10.4-stable+timestamp.2015.04.26.15.11.54 (Running on Rocket 1.2.6, Python 2.7.9) -- 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: routes_onerror doesn't redirect to a custom controller when an invalid request error is produced
++11 how regirect if function or controller not found?? invalid function invalid controller routes.py in app_folder not worked (( routes_onerror = [ ('*/404', 'my_app/deal/index'), ... not worked ( -- 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: addremove; hg api change again
Hi Dave, I am a mercurial-cli very addicted user. In my very very very personal opinion mercurial is better than git for my projects, but now I'm not looking for a flame mercurial vs git or hg-cli vs hg-api. I have an engineering problem. Can I base my next project on hg api? Now I know that hg api server does not have the promise of stability and this partly answers my question. In spite of all I would like to use mercurial and web2py and, if necessary, to produce a patch to make sure that web2py functions with an updated version of hg server api. I'm sorry for my silly question but can you tell me where to find the documents relating to api server and preferably with code snippet explain how to use it? help(mercurial.scmutil.addremove()) is not enought for me I need to learn more about the API server After that everybody wins, mercurial, web2py and also my project may be more popular! ;-) Many thanks Fabrizio P.S. Anyone can answer the question, do not be shy! ;-) [...snip...] The Mercurial command server is a way of using commands without repeatedly shelling out, but for the amount of use needed from Web2Py, shelling out is probably good enough. /dps [...snip...] On Friday, 17 July 2015 08:16:53 UTC-5, zenze...@gmail.com wrote: Ciao, I want to use https://kallithea-scm.org/ as mercurial repository web interface. Everything works fine except one last step in web2py web interface. When I click on the Versioning web interface button I get the error: Versione web2py™ Version 2.11.2-stable+timestamp.2015.05.30.11.29.46 Python Python 2.7.5: /usr/bin/python (prefix: /usr) Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Traceback (most recent call last): File /var/www/devel/web2py/gluon/restricted.py, line 227, in restricted exec ccode in environment File /var/www/devel/web2py10/applications/admin/controllers/mercurial.py https://devel.zenzeromod.com/admin/default/edit/admin/controllers/mercurial.py, line 87, in module File /var/www/devel/web2py/gluon/globals.py, line 412, in lambda self._caller = lambda f: f() File /var/www/devel/web2py10/applications/admin/controllers/mercurial.py https://devel.zenzeromod.com/admin/default/edit/admin/controllers/mercurial.py, line 50, in commit addremove(repo) TypeError: addremove() takes at least 3 arguments (1 given) Is there anyone who uses the creation of the repository via the web using the addremove method new signature? Can you suggest a piece of code to pass the correct parameters? Because I can not understand from the documentation of the method mercurial.scmutil.addremove() what are the right ones. Fabrizio P.S. Mercurial Distributed SCM (version 3.3.3), Centos (7) OS, -- 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: Invalid password reset
Same with me... Am Mittwoch, 15. Juli 2015 08:42:39 UTC+2 schrieb Annet: This would happen if the user has already clicked the link. This also happens when clicking the link for the very first time, I noticed this after upgrading to version 2.10. Kind regards, Annet -- 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
why it better than code in /models/0.py ? response.db_cs = 'DB_CONN_STR' or DB_SC = 'DB_CONN_STR' четверг, 16 июля 2015 г., 5:29:03 UTC+3 пользователь Alex написал: thanks for the AppConfig implementation! this is really useful and allows easy configuration of db connections. Actually I posted a question about this a few years ago - in the meantime I found a workaround but I'll change it to AppConfig soon. Is this already mentioned in the book somewhere? I couldn't find it. 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] forms
I am trying something with form in which on selecting some thing in select tag i should get some data from database based on select tag value.So on select tag i used ajax call but the ajax response text is difficult to parse is there any other way? Thanks in advance :) -- 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: crash - session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) on 2.9.11
how solve it without edit pickle.HIGHEST_PROTOCOL ? вторник, 7 июля 2015 г., 8:42:50 UTC+3 пользователь Dmitry Ermolaev написал: This error in sessions and then raise in pickle пятница, 3 июля 2015 г., 23:50:25 UTC+3 пользователь Dmitry Ermolaev написал: I continue tests... Any request with some PORT (for example http://mydom:PORT) after restarting Apache will take this PORT as success but all others PORTS as error for example if first request is http://my_domain:90 than app request wirt PORT != 90 - raise error! пятница, 3 июля 2015 г., 22:29:43 UTC+3 пользователь Dmitry Ermolaev написал: in 2.11 error: Traceback (most recent call last): File C:\web2py-m\gluon\main.py, line 436, in wsgibase session.connect(request, response) File C:\web2py-m\gluon\globals.py, line 960, in connect session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) File C:\web2py-m\gluon\storage.py, line 56, in lambda __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self) TypeError: getattr(): attribute name must be string I identified this error: If server has HTTP and HTTPS requests.When Apache was restarted or reloaded then: First request will be successful and its schema will be successful but another schema will raise this error for examle: 1. After restarting Apache if first request to server was a http://mydomain/... then all request with HTTP schema will be successful but all request with HTTPS will be raise this error 2. After restarting Apache if first request to server was a https://mydomain/... then all request with HTTPS schema will be successful but all request with HTTP will be raise this error Apache config: # VirtualHost *:80 RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} /VirtualHost VirtualHost *:443 ServerName 7pay.in ServerAlias www.7pay.in DocumentRootC:/web2py-m SSLEngine on Directory C:/web2py-m AllowOverride All Order allow,deny allow from all /Directory Location / Order deny,allow Allow from all /Location WSGIScriptAlias / C:/web2py-m/wsgihandler.py SSLCertificateFile conf/NameCheap.com/7pay_in.crt SSLCertificateKeyFile conf/NameCheap.com/7pay-server.key SSLCertificateChainFile conf/NameCheap.com/7pay_in.ca-bundle LogFormat %h %l %u %t \%r\ %s %b common ErrorLog logs/spay.log CustomLog logs/spay-access.log common /VirtualHost ### VirtualHost *:80 ServerName erm.cash ServerAlias www.erm.cash ServerAlias ipo-polza.ru ServerAlias www.ipo-polza.ru ServerAlias XN--80AAXIDK7E.XN--80ASEHDB ServerAlias www.XN--80AAXIDK7E.XN--80ASEHDB DocumentRootC:/web2py-m Directory C:/web2py-m AllowOverride All Order allow,deny allow from all /Directory Location / Order deny,allow Allow from all /Location WSGIScriptAlias / C:/web2py-m/wsgihandler.py LogFormat %h %l %u %t \%r\ %s %b common ErrorLog logs/web2py.log CustomLog logs/web2py-access.log common /VirtualHost HELP ! -- 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] Use wkhtmltopdf in web2py
Hi I am going to use wkhtmltopdf in a web2py application for generate pdf file. I see only another topic about wkhtmltopdf in this forum and I understand that i have to use calls service but I the line of command is for me incorrect.There is a example online with the call for use wkhtmltopdf with this framework? If I can use call service you can give me how can i write the line of calls or in another case you can give a me a example for use wkhtmltopdf? -- 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.