[web2py] Re: How do I configure my domain to hosting PythonAnywhere
https://www.pythonanywhere.com/wiki/OwnDomains Le dimanche 14 septembre 2014 17:20:54 UTC+2, Капылов Данил a écrit : How do I configure my domain to hosting PythonAnywhere Give detailed step by step instructions in please -- 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: how to iterate through sqlite data and display on web2py
Hi 1. I note that the code: match_row = db(db.keywords.x.contains('|%s|' % keyword)).select().first(). This picks the first item in he list. How about a random search through the list without using select().first()? 2. In my code: def types: db = DAL('sqlite.storage.db') db.define_table('types' Field('body')) rows = db(db.types.body.id0)select() for item in row: item = item return item. I GET AN ERROR: NoneType item not iterable. I want the user to put in any data e.g. '123' and if boolean(True) it prints out the answer.I am using this code on a ython module imported to web2py and not in the controller. In my view: {{=item}} On Tue, Sep 9, 2014 at 4:21 PM, Maurice Waka mauricew...@gmail.com wrote: Hey thanks alot! let me work on this then. Kind regards On Tue, Sep 9, 2014 at 3:55 PM, Anthony abasta...@gmail.com wrote: On Tuesday, September 9, 2014 8:40:04 AM UTC-4, Maurice Waka wrote: Thanks for the input. Yes it is part of a web2py app game. I have about 1000 rows, but when a user types in the keyword(stored in any of the rows) i should get a boolean answer which for now displays the row(different code on this) OK, but how are the rows stored in SQLite? Are they just strings, like ['123', '1234', '12345', ]? If so, you can do a query searching for the string '[keyword]', within each row to return rows with a matching keyword. Again, I would recommend using the DAL with a list:string field: db.define_table('keywords', Field('x', 'list:string')) This allows you to insert and extract actual Python lists from the field, though the lists will be stored in the database as a string in the form |item1|item2|item3|. So, to find rows that match a keyword, you would just do: keyword = '123' # in reality, this is obtained via user input match_row = db(db.keywords.x.contains('|%s|' % keyword)).select().first() Your boolean test would then simply be if match_row:. The list of keywords in the matching row would be in match_row.x, which would be an actual Python list rather than a string representation of a list. 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 a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/dNtVIOucH9Q/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. -- Dr Maurice Waka, MBCHB. Nairobi -- Dr Maurice Waka, MBCHB. Nairobi -- 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] log on file
I tryed to set up a logger in my app following the manual but I cannot see any file created under the logs directory. Here they are modifications I made to files... can you see anything wrong? * logging.conf (located under web2py/applications/myapp/) [loggers] - keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome + keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome,teleservice [...] + # teleservice app handler + [logger_teleservice] + level=WARNING + qualname=web2py.app.teleservice + handlers=rotatingFileHandler + propagate=0 * db.py (at the beginning) + import logging + logger = logging.getLogger(web2py.app.teleservice) + if DEVELOPMENT: + logger.setLevel(logging.DEBUG) + else: + logger.setLevel(logging.WARNING) Thank you very mutch Cheers Manuele -- 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 Book inconsistency and Reference to auth_user table has no recursive attributes
Great. This is a really *thorough* answer. I appreciate it, Anthony. Let web2py stay focused, and let others (pandas etc.) do what they are good at :) -- 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: bootstrap 3 - if you care help test trunk now
Is there a way I can default all of my forms to bootstrap3_inline? -Jim On Saturday, August 9, 2014 2:13:38 AM UTC-5, Massimo Di Pierro wrote: Bootstrap 3 is in trunk now. Please help us test it. Also help us test that existing apps are not broken. Massimo -- 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: Minimize CSS ( custom.widget) statements for custom styled forms
That code is a huge WTF. None of this should be in the controller, it should be in the view. There should be no need to use _style. Why aren't you using the 'bootstrap3_stacked' (or inline) formstyle to start with or just using your own custom made formstyle? Furthermore, placeholders can be passed directly to the fields widget or you can make them automatically from the labels using something like this: def label2placeholder(form): for label in form.elements('label'): input = form.element('#%s' % label['_for']) if input: input['_placeholder'] = label.components[0] -- 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: how to iterate through sqlite data and display on web2py
On Wednesday, September 17, 2014 9:12:11 AM UTC-4, Maurice Waka wrote: Hi 1. I note that the code: match_row = db(db.keywords.x.contains('|%s|' % keyword)).select().first(). This picks the first item in he list. How about a random search through the list without using select().first()? db(db.keywords.x.contains('|%s|' % keyword)).select(orderby='random'). first() 2. In my code: def types: db = DAL('sqlite.storage.db') db.define_table('types' Field('body')) rows = db(db.types.body.id0)select() for item in row: item = item return item. I GET AN ERROR: NoneType item not iterable. I want the user to put in any data e.g. '123' and if boolean(True) it prints out the answer.I am using this code on a ython module imported to web2py and not in the controller. In my view: {{=item}} A few problems: - Should be db.types.id 0, not db.types.body.id 0. - If you have return item in your for loop, it will simply return during the first iteration of the loop. Instead, you should just return the Rows object and let the view iterate and display all the items. - If this code is in a module, the return value of the function will not be available in a view. When a controller function returns a dict, the keys in the dict become global variables in the associated view. So, if you want to pass something from a function in a module to a view, the module function should be called by the controller function (alternatively, the view can directly import and call the module function, but that pattern is discouraged -- try to keep the views to presentation logic). It might help if you spend a little more time with the web2py documentation to better understand how everything works together. 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: bootstrap 3 - if you care help test trunk now
Officially not yet Jim. You can set response.formstyle but this may change so I wouldn't use it for now. See discussion here: https://groups.google.com/forum/#!topic/web2py-developers/43xNoDmB0rU -- 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 return a more specific error message from auth.login(), rather than a generic invalid login
Thanks for the help guys! I've implemented something similar to Leonel's suggestion for now. I've also posted a Google Code issue about this: https://code.google.com/p/web2py/issues/detail?id=1984 On Monday, September 15, 2014 5:43:56 PM UTC-7, Anthony wrote: On Monday, September 15, 2014 2:20:06 PM UTC-4, Mark Li wrote: Ahhh, that is quite frustrating! I see this a quite a big usability improvement at virtually no cost to security; would an optional parameter like auth.login(return_specific_error=True) still fail security checks for owasp? Maybe post a Google Code issue requesting something like this. I think maybe we could adjust the code to pass the reason for the failure to the login_onfail callback, which could then change the session flash or set some other flag in the session (no need for a new return_specific_error argument). 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: Deploying Web2py with nginx on FreeBSD
El miércoles, 10 de septiembre de 2014 13:03:13 UTC-3, myappeng...@gmail.com escribió: Hi, everyone. I'm in the process of deploying Web2py with nginx on FreeBSD. Does anyone have a deployment script for this configuration. All the recipes I have seen are for Linux and I'm having difficulties converting them for FreeBSD. I have installed nginx and uwsgi succesfully, but I get a permissions error [forbidden 403] when I web on to the nginx server. Many Thanks Mike hi Mike Please, wait a while and I send you a step by step tutorial. -- 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: bootstrap 3 - if you care help test trunk now
Ok, for now I'll just hardcode it on my SQLFORM.grid calls. Another issue I'm having is that some of my buttons look like they have overlayed images on them. I've attached a sample. The code that is getting generated looks like this: td class=row_buttons nowrap=nowrap a class=button btn btn-default href= /infocenter/user/index/edit/auth_user/3059?_signature=4fd3e76ccc3017c25f56e3ee3db00f834b683818 span class=icon pen icon-pencil glyphicon glyphicon-arrow-pencil/span span class=buttontext button title=EditEdit/span /a a id=230f96c0-8490-4147-a415-d268f9c7698a class=button btn btn-default href= /infocenter/user/index/delete/auth_user/3059?_signature=453319f27fb9445e1b0f76dcde5bdb1012b56b7f data-w2p_remove=tr data-w2p_method=POST data-w2p_disable_with=default data-w2p_confirm=default span class=icon trash icon-trash glyphicon glyphicon-trash/span span class=buttontext button title=DeleteDelete/span /a /td Any ideas why those double images are showing on the delete button and nothing is showing on the edit button? -Jim On Wednesday, September 17, 2014 12:01:27 PM UTC-5, Leonel Câmara wrote: Officially not yet Jim. You can set response.formstyle but this may change so I wouldn't use it for now. See discussion here: https://groups.google.com/forum/#!topic/web2py-developers/43xNoDmB0rU -- 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: bootstrap 3 - if you care help test trunk now
Also, if I remove the icon trash icon-trash from the class on the image span (on the delete button) the proper delete image shows up. -Jim On Wednesday, September 17, 2014 1:15:58 PM UTC-5, Jim S wrote: Ok, for now I'll just hardcode it on my SQLFORM.grid calls. Another issue I'm having is that some of my buttons look like they have overlayed images on them. I've attached a sample. The code that is getting generated looks like this: td class=row_buttons nowrap=nowrap a class=button btn btn-default href= /infocenter/user/index/edit/auth_user/3059?_signature=4fd3e76ccc3017c25f56e3ee3db00f834b683818 span class=icon pen icon-pencil glyphicon glyphicon-arrow-pencil /span span class=buttontext button title=EditEdit/span /a a id=230f96c0-8490-4147-a415-d268f9c7698a class=button btn btn-default href= /infocenter/user/index/delete/auth_user/3059?_signature=453319f27fb9445e1b0f76dcde5bdb1012b56b7f data-w2p_remove=tr data-w2p_method=POST data-w2p_disable_with= default data-w2p_confirm=default span class=icon trash icon-trash glyphicon glyphicon-trash/span span class=buttontext button title=DeleteDelete/span /a /td Any ideas why those double images are showing on the delete button and nothing is showing on the edit button? -Jim On Wednesday, September 17, 2014 12:01:27 PM UTC-5, Leonel Câmara wrote: Officially not yet Jim. You can set response.formstyle but this may change so I wouldn't use it for now. See discussion here: https://groups.google.com/forum/#!topic/web2py-developers/43xNoDmB0rU -- 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: bootstrap 3 - if you care help test trunk now
Yes that's not right jim, bootstrap3 should only have the version glyphicon and bootstrap2 shouldn't. What you should do is send your own ui dict to grid, something like this on your grid call ui = dict(widget='', header='', content='', default='', cornerall='', cornertop='', cornerbottom='', button='btn btn-default button', buttontext='buttontext button', buttonadd='glyphicon glyphicon-plus', buttonback='glyphicon glyphicon-arrow-left', buttonexport='glyphicon glyphicon-download', buttondelete='glyphicon glyphicon-trash', buttonedit='glyphicon glyphicon-arrow-pencil', buttontable='glyphicon glyphicon-arrow-right', buttonview='glyphicon glyphicon-arrow-zoom-in', ) -- 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: log on file
logging.conf should be in the root dir, not in the app dir. On Wednesday, September 17, 2014 3:26:18 PM UTC+2, Manuele wrote: I tryed to set up a logger in my app following the manual but I cannot see any file created under the logs directory. Here they are modifications I made to files... can you see anything wrong? * logging.conf (located under web2py/applications/myapp/) [loggers] - keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome + keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome,teleservice [...] + # teleservice app handler + [logger_teleservice] + level=WARNING + qualname=web2py.app.teleservice + handlers=rotatingFileHandler + propagate=0 * db.py (at the beginning) + import logging + logger = logging.getLogger(web2py.app.teleservice) + if DEVELOPMENT: + logger.setLevel(logging.DEBUG) + else: + logger.setLevel(logging.WARNING) Thank you very mutch Cheers Manuele -- 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: Deploying Web2py with nginx on FreeBSD
0.1 Web2py # cd /home # fetch http://www.web2py.com/examples/static/web2py_src.zip # unzip web2py_src.zip # cp /home/web2py/handlers/wsgihandler.py /home/web2py/ # chown -Rh www:www web2py 0.2 uWSGI # cd /usr/ports/www/uwsgi # make install clean Create the file /usr/local/etc/uwsgi.ini *[uwsgi] * *pythonpath = /home/web2py/ * *module = wsgihandler * *socket = 127.0.0.1:9001 * *master = true * *chmod-socket = 664 * *uid = www * *gid = www * *#enable-threads = true * *processes = 4 * *socket-timeout = 180 * *post-buffering = 8192 * *max-requests = 1000 * *buffer-size = 32768* edit /etc/rc.conf: *nginx_enable=YES * *uwsgi_enable=YES * *uwsgi_flags=-T –ini /usr/local/etc/uwsgi.ini* 0.3 Nginx # cd /usr/ports/www/nginx # make install clean Add to /usr/local/etc/nginx/nginx.conf in server section: *location ~ /welcome { * *uwsgi_pass 127.0.0.1:9001; * *#uwsgi_pass unix:/tmp/web2py.sock; * *include uwsgi_params; * *}* 0.4 Start Services #service uwsgi start #service nginx start -- 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] Accesing table from external database
Hello! I need to populate a combobox in a FORM (or SQL FORM) with the content of a field of a table which is in an external SQL Server database. I know that is not possible to reference an external database using DAL, but how can I to load the content of the external field in a SQLFORM field (combobox)? Any idea? 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.
Re: [web2py] Re: bootstrap 3 - if you care help test trunk now
Thanks, that worked great. NOTE: This line is incorrect: buttonedit='glyphicon glyphicon-arrow-pencil', Should be: buttonedit='glyphicon glyphicon-pencil', -Jim On Wed, Sep 17, 2014 at 1:27 PM, Leonel Câmara leonelcam...@gmail.com wrote: Yes that's not right jim, bootstrap3 should only have the version glyphicon and bootstrap2 shouldn't. What you should do is send your own ui dict to grid, something like this on your grid call ui = dict(widget='', header='', content='', default='', cornerall='', cornertop='', cornerbottom='', button='btn btn-default button', buttontext='buttontext button', buttonadd='glyphicon glyphicon-plus', buttonback='glyphicon glyphicon-arrow-left', buttonexport='glyphicon glyphicon-download', buttondelete='glyphicon glyphicon-trash', buttonedit='glyphicon glyphicon-arrow-pencil', buttontable='glyphicon glyphicon-arrow-right', buttonview='glyphicon glyphicon-arrow-zoom-in', ) -- 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/HWZ_4gyUSPo/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: Accesing table from external database
What do you mean by external database? Are you actually meaning a legacy database that the DAL didn't create itself? You can certainly connect web2py to such a database through the DAL or even just using db.executesql(). If you need to get a list of valid options for your combobox you can do something like this. choices = db.executesql(SELECT name_field, id_field FROM sometable WHERE foo = ? ORDER BY name_field, (foo_value), as_dict = True) choice_options = [OPTION(c['name_field'], c['id_field']) for c in choices] valid_options = (c['id_field'] for c in choices) #then while you're creating a FORM() SELECT(*choice_options, **dict(_name=my_field, requires = IS_IN_SET( valid_options)) On Wednesday, September 17, 2014 2:39:37 PM UTC-5, José Eloy wrote: Hello! I need to populate a combobox in a FORM (or SQL FORM) with the content of a field of a table which is in an external SQL Server database. I know that is not possible to reference an external database using DAL, but how can I to load the content of the external field in a SQLFORM field (combobox)? Any idea? 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: Comments/notes and api documentation
I'd like to see a wiki... it could be run on web2py even... On Tuesday, September 16, 2014 3:12:52 PM UTC-7, Anthony wrote: Maybe submit a Github issue in the book repo requesting this feature. Anthony On Tuesday, September 16, 2014 6:12:06 PM UTC-4, Anthony wrote: Agreed, but for the most part, if something is truly lacking from the documentation, it would be best if it could be included in the documentation itself, rather than in a long list of unorganized comments at the bottom of the page. You can always make a pull request on the book repo (https://github.com/mdipierro/web2py-book) for direct changes to the documentation. Allowing user comments/feedback isn't a bad idea, though, but we would probably have to change the UI -- currently each chapter is a very long HTML page, and putting comments at the bottom would in many cases place them very far from the relevant context in the chapter. Note, the old version of the book did in fact allow comments at the bottom of each page (though there was no upvote/downvote feature), but that functionality was not migrated to the newer book app. Anthony On Tuesday, September 16, 2014 6:02:42 PM UTC-4, Robin Manoli wrote: It's not really what I'm looking for. There are many benefits to the php documentation way: 1. the comments are where you are looking for help 2. when you are looking for help, and find a solution of your own, you can post it where you were looking 3. the current documentation is unclear in many places, and it's not very efficient to browse around the form/slices/stackoverflow/examples to get to the solution, when it could already be there where you look first 4. the documentation could become verbose instead of lacking 5. there are many little tricks that i have read about in the forum that i couldn't find in the documentation... if all these tricks would be more accessible, web2py's many hidden features could be used more Den torsdagen den 11:e september 2014 kl. 00:27:10 UTC+2 skrev Anthony: It's not embedded with the main documentation, but for user contributed content, we do have http://www.web2pyslices.com/home. Anthony On Wednesday, September 10, 2014 5:55:36 PM UTC-4, Robin Manoli wrote: Hey, the php documentation has user comments with examples of how to use different functions. This is a great complement to their documentation. With web2py I have stumbled upon many things in these forums that I have not seen in the documentation. I'm not sure how often you update it, since I keep finding new things there too. Still, don't you think it would be better if we all could contribute with common and examples to an api-type of documentation for web2py? I think the php documentation does this really well. -- 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: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).
My previous post was somewhat off. Actually, what happens is that if the form passes validation, but has incorrect login credentials, auth.login() will trigger a redirect with the following code: redirect(self.url(args=request.args, vars=request.get_vars), client_side=settings.client_side) Upon redirect, the form.vars are lost, and thus the form is no pre-populated with the previously typed in value. This redirect does not occur if the form does not pass validation (such as having an invalid email), and thus the returned form still has form.vars If the login credentials are incorrect, the returned form should have all the previously typed in values (except for the password for security reasons), so the user can see where they made the error. If you return a blank form, the user must guess what they typed in the username/email input, which is needlessly frustrating. On Monday, September 15, 2014 1:42:10 PM UTC-7, Mark Li wrote: After submitting a failed login attempt with auth.login(), the failed username input is not returned (it is cleared out). This is not a problem when auth.define_tables(username=False), which would return the failed email input upon login error. But, when username=True, the form no longer returns the failed input after a login error. This would be an important issue for users, because they don't see their failed credentials that they previously typed (excluding the password). I added a print request.function to the model, and after a failed login attempt (with auth.define_tables(username=True)), there is a double redirect, which seemed to cause problems previously as well: https://groups.google.com/forum/#!searchin/web2py/auth.login$20return$20username/web2py/9omfJYNoOC8/RrLOgeXENvMJ -- 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: auth.login() does not return input value (username) on error, if auth.define_tables(username=True).
Is there a reason for this behavior? Or is it a bug? On Wednesday, September 17, 2014 4:34:44 PM UTC-7, Mark Li wrote: My previous post was somewhat off. Actually, what happens is that if the form passes validation, but has incorrect login credentials, auth.login() will trigger a redirect with the following code: redirect(self.url(args=request.args, vars=request.get_vars), client_side=settings.client_side) Upon redirect, the form.vars are lost, and thus the form is no pre-populated with the previously typed in value. This redirect does not occur if the form does not pass validation (such as having an invalid email), and thus the returned form still has form.vars If the login credentials are incorrect, the returned form should have all the previously typed in values (except for the password for security reasons), so the user can see where they made the error. If you return a blank form, the user must guess what they typed in the username/email input, which is needlessly frustrating. On Monday, September 15, 2014 1:42:10 PM UTC-7, Mark Li wrote: After submitting a failed login attempt with auth.login(), the failed username input is not returned (it is cleared out). This is not a problem when auth.define_tables(username=False), which would return the failed email input upon login error. But, when username=True, the form no longer returns the failed input after a login error. This would be an important issue for users, because they don't see their failed credentials that they previously typed (excluding the password). I added a print request.function to the model, and after a failed login attempt (with auth.define_tables(username=True)), there is a double redirect, which seemed to cause problems previously as well: https://groups.google.com/forum/#!searchin/web2py/auth.login$20return$20username/web2py/9omfJYNoOC8/RrLOgeXENvMJ -- 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] Current logged in users
Hi Folks, Is there a way to list the current logged in users? Regards, Tito -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- 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: Current logged in users
See http://stackoverflow.com/questions/12218989/get-all-logged-in-users-web2py/12224157#12224157. Anthony On Wednesday, September 17, 2014 8:48:22 PM UTC-4, Tito Garrido wrote: Hi Folks, Is there a way to list the current logged in users? Regards, Tito -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___ -- 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: Comments/notes and api documentation
Have you seen the medium.com in-context notes? That would be a great way to bring it all together: https://medium.com/about/why-medium-notes-are-different-and-how-to-use-them-well-5972c72b18f2 There's even a jQuery clone that could be used: https://github.com/aroc/side-comments On Thursday, September 18, 2014 11:07:44 AM UTC+12, Derek wrote: I'd like to see a wiki... it could be run on web2py even... On Tuesday, September 16, 2014 3:12:52 PM UTC-7, Anthony wrote: Maybe submit a Github issue in the book repo requesting this feature. Anthony On Tuesday, September 16, 2014 6:12:06 PM UTC-4, Anthony wrote: Agreed, but for the most part, if something is truly lacking from the documentation, it would be best if it could be included in the documentation itself, rather than in a long list of unorganized comments at the bottom of the page. You can always make a pull request on the book repo (https://github.com/mdipierro/web2py-book) for direct changes to the documentation. Allowing user comments/feedback isn't a bad idea, though, but we would probably have to change the UI -- currently each chapter is a very long HTML page, and putting comments at the bottom would in many cases place them very far from the relevant context in the chapter. Note, the old version of the book did in fact allow comments at the bottom of each page (though there was no upvote/downvote feature), but that functionality was not migrated to the newer book app. Anthony On Tuesday, September 16, 2014 6:02:42 PM UTC-4, Robin Manoli wrote: It's not really what I'm looking for. There are many benefits to the php documentation way: 1. the comments are where you are looking for help 2. when you are looking for help, and find a solution of your own, you can post it where you were looking 3. the current documentation is unclear in many places, and it's not very efficient to browse around the form/slices/stackoverflow/examples to get to the solution, when it could already be there where you look first 4. the documentation could become verbose instead of lacking 5. there are many little tricks that i have read about in the forum that i couldn't find in the documentation... if all these tricks would be more accessible, web2py's many hidden features could be used more Den torsdagen den 11:e september 2014 kl. 00:27:10 UTC+2 skrev Anthony: It's not embedded with the main documentation, but for user contributed content, we do have http://www.web2pyslices.com/home. Anthony On Wednesday, September 10, 2014 5:55:36 PM UTC-4, Robin Manoli wrote: Hey, the php documentation has user comments with examples of how to use different functions. This is a great complement to their documentation. With web2py I have stumbled upon many things in these forums that I have not seen in the documentation. I'm not sure how often you update it, since I keep finding new things there too. Still, don't you think it would be better if we all could contribute with common and examples to an api-type of documentation for web2py? I think the php documentation does this really well. -- 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] LOAD problem with ajax=True
I have a strange problem which I can't figure out. I have the following code in my main index.html view: {{left_sidebar_enabled=True,right_sidebar_enabled=False,('message' in globals())}} {{extend 'layout.html'}} {{=LOAD('default','action.load',args=request.args,vars=request.vars, ajax= True, ajax_trap=True, target='action')}} {{block left_sidebar}} {{=LOAD('default','refresh.load',ajax=True, target='tasklist')}} {{end}} The problem is that these components loaded using the LOAD function are getting rendered within the initial page view instead of being loaded afterwards using ajax. Also, the form within the component doesn't get trapped either, which is how I noticed this in the first place. On clicking the submit button I get the form response replacing the whole page instead of being loaded into the relevant DIV element. I have checked using the DHTTP utility in windows (which downloads a web page from the command line) to check what is returned without javascript getting involved, I see the full HTML from these two components in the index response, including the form elements from the action.load view. I did this initially on v 2.9.9, but also upgraded to trunk (2.9.11) on the off chance this was a bug. I have done a simple test in another application on the same web2py installation and this works okay, so I'm at a loss to see why it doesn't work in this case. Any ideas what might be going on? -- 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] Correction/patch for web2py.js trap_form function.
I have spotted a scenario where the web2py.js trap_form function does not work correctly. https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L265 Currently looks like this: var url = form.attr('action'); if ((url === ) || (url === #)) { /* form has no action. Use component url. */ url = action; } Hoever, if the form has no attribute called action then the url variable is not defined, which the if statement does not test for. Can I suggest this code needs changing to the following: var url = form.attr('action'); if ((url === ) || (url === #) || (typeof url === 'undefined')) { /* form has no action. Use component url. */ url = action; } Now if the query to get the action attribute of the form return undefined, this will be recognised and the component's url used instead. 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: web2py 2.9.10 is OUT
On its days I read the changelog on release 2.9.7 and completely missed this bug. -- better cache.dick (thanks Leonel) +- better cache.disk (thanks Leonel) Nice catch. On Monday, September 15, 2014 8:15:43 AM UTC-5, Massimo Di Pierro wrote: web2py 2.9.10 is out. It fixes some important bugs and upgrades some contrib. packages. -- 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 meetup Bay Area
I am new to web2py, but would be interested in attending, thank you for taking the initiative to set something up! On Thursday, September 11, 2014 9:24:53 AM UTC-7, weheh wrote: Thanks for the replies. I went to a meetup last night for the Bay Area python group (not the Bay Area Piggies group), which is one of the largest if not the largest python group in the North Bay. I also looked into setting up a more permanent meetup group for web2py. Here are my conclusions and reasonings about how to go forward with a web2py meetup. We should leverage the existing python group(s) (including Piggies) to spread knowledge of web2py. The python meetup is a large, established group with the necessary infrastructure to organize meetups. I think it will be hard (for me) to start a web2py group from scratch right now because it requires connections to big and interested internet companies with adequate facilities and a willingness to host the meetup. I spoke to the organizers of the python meetup regarding having a web2py session. They were open and receptive to the idea. Some of them remembered Massimo's talk a couple of years ago. One of the organizers volunteered to me that there was some negative sentiment surrounding web2py in the python community, but when I dug deeper, it seemed to be rumor and innuendo, nothing concrete. Seems like the usual controversy that has dogged web2py since day 1 for reasons that are beyond me. Therefore, Massimo, if you're out here in November, let's have you do a short tutorial on web2py (30 to 45 minutes). Then I, and hopefully someone else (Jonathan, Joe?), can give testimonial talks on what we like about web2py and give concrete examples/demos of how we use it for enterprise-grade solutions. I am prepared to put together some examples of cool things you can do with components, rpc calls, multiple forms on one page, etc. The testimonial talks should also be 30 to 45 minutes so that in total, there would be more talks by web2py users than Massimo. This will lend greater credibility to the information exchange and be more convincing that there is, indeed, a movement. I would also use the occasion to poll the gathering to see if there's enough interest to start our own web2py meetup group. The organizers said that if I wanted to drive such a meetup for the python group that they might also invite competing frameworks to give talks, like Django or Flask. That's possible, but I think if we have enough web2py-user speakers we can probably get the full 2 hours for web2py talks. That, in my opinion, would be preferable. Let me know what you think. Massimo, if you're here in November, there's enough time to organize something great for that time frame. -- 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: Reload a component form another component without submit form
ooops, sorry niphlod, I've only read on w3schools.com site about the on() function. And furthermore I test the code above without changing the ajax parameter of the 2nd LOAD to True... aargh, not serious. But now, it finally works this way : {{extend 'layout.html'}} {{ =LOAD('default','army_header.load', ajax=True , ajax_trap=False , user_signature=True, target='army_header') }} {{ =LOAD('default','cards_list.load', ajax=True ,ajax_trap=False, user_signature=True, target='cards_list', vars={'mode':'edit'}) }} script jQuery('#cards_list').on(dblclick,tr, function() { var sid = jQuery(this).prop('id'); ajax('on_card_selected?card_id='+sid,[] ,'target') ; ajax( {{=URL('default', 'update_army.load' ) }},[],'army_header'); }); /script.. I really need to improve myself with jquery, I'm not in line with it. -- 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] How can we organize the automatic posting to social networks Twitter and faсebook, vkontakt, google+
How can we organize the automatic posting to social networks Twitter and faсebook, vkontakt, google+ Prompt as materials and lessons how to work with veb2py and social networks. -- 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.9.10 is OUT
Bien... A probar ...gracias..graciass. well ... to test Thank you Thank you El lunes, 15 de septiembre de 2014 08:15:43 UTC-5, Massimo Di Pierro escribió: web2py 2.9.10 is out. It fixes some important bugs and upgrades some contrib. packages. -- 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't edit default.py after upgrade to 2.8.2
I'm having this same problem since upgrading from 2.8.2 to 2.9.9 Error in console when loading a newly created file is... Uncaught TypeError: Cannot read property 'length' of undefined comment-fold.js:24(anonymous function) comment-fold.js:24(anonymous function) foldcode.js:113getRange foldcode.js:18doFold foldcode.js:31(anonymous function) foldcode.js:69(anonymous function) VM977:23(anonymous function) jquery.js:2m.extend.globalEval jquery.js:2m.fn.extend.domManip jquery.js:3m.fn.extend.append jquery.js:3(anonymous function) ajax_editor.js:259j jquery.js:2k.fireWith jquery.js:2x jquery.js:4b nginx webserver On Wednesday, 11 December 2013 17:17:40 UTC-5, Richard Brown wrote: Yes, it was working fine until I upgraded Web2py. I can open it to view (peek) and it's all there OK, but if I try to edit I get a blank page. If I create a new file from the Admin Interface in the 'controllers' group it behaves in exactly the same way - and this is created by Web2py. I can also see the files and their privileges via WinSCP. I can edit any other file in my design (views, modules, databases, database admin etc) just not anything in controllers. The 'Network' tab in Chrome's JavaScript console (see earlier post) shows the file in red and the Status as 'cancelled'. -- 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] How can I create a virtualenv and follow this instruction in web2py?
Please somebody help me on how to go about following this instruction below. On a mission to create something http://feeds.uni.me/ (RSS Feed reader) I don't know exactly where to start. where can I find the web2py commandline to help create the virtualenv? Or is it not all going to be done within a commandline? Please help me clear my confusion and start. Thank you - This is not an plug-n-play web2py application there are some work to be done. Follow some install instructions - I hope completed: create a virtualenv and install: pip install feedparser pip install bs4 pip install beautifulsoup4 pip install FilterHTML pip install times pip install guess-language pip install whoosh pip install lxml pip install bottle run the initial setup: $ python web2py.py -MS feeds -R applications/feeds/scripts/setup.py it will create a user a...@a.aa with pass 1234, and fetch one reddit feed. to periodically fetch feeds, run: $ python web2py.py -MS feeds -R applications/feeds/modules/feeds_update.py -- 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.9.10 is OUT
cool thank you. you can tell us the new upgrades please Le lundi 15 septembre 2014 15:15:43 UTC+2, Massimo Di Pierro a écrit : web2py 2.9.10 is out. It fixes some important bugs and upgrades some contrib. packages. -- 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: Reload a component form another component without submit form
For now I'm using the walkaround below to solve the second problem, consisting of two separate ajax call : script jQuery(document).ready(function() { jQuery('tr.w2p_even.even.with_id,tr.w2p_odd.odd.with_id ').on( dblclick,function() { var sid = jQuery(this).prop('id'); ajax('on_card_selected?card_id='+sid,[] ,'target') ; ajax( {{=URL('default', 'update_army.load' ) }},[], 'army_header'); ; } ); } ); /script It works well 99% of time until the double click are not too fast from the end user : in this particular case, second call can be lower than the first one. As the first update db and the second read the db it results on no refresh on the screen until user press F5 to force it manually which is not suitable. -- 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] share tip to calculate hours from database
I share with you a solution that gives leonel camara to a problem that I encounter my question : users must score the hours or minutes of work performed on the project. it's for Timesheet software. obligation: the data must be store in database , so virtual field impossible. the solution was give by leonel camara (thanks lot!!) one thing you can do is store the time in the database as an integer representing minutes or seconds if you need that much resolution the user can input hours minutes etc and you convert it to a single number in minutes. from gluon.validators import Validator, translate, regex_time class IS_SECONDS(Validator): def __init__(self, error_message='Enter time as hh:mm:ss'): self.error_message = error_message def __call__(self, value): try: ivalue = value value = regex_time.match(value.lower()) (h, m, s) = (int(value.group('h')), 0, 0) if not value.group('m') is None: m = int(value.group('m')) if not value.group('s') is None: s = int(value.group('s')) return (h*3600 + m*60 + s, None) except AttributeError: pass except ValueError: pass return (ivalue, translate(self.error_message)) db.define_table('planing', Field('seconds_worked', 'integer', widget=SQLFORM.widgets.time.widget, requires=IS_SECONDS(), label=T('Time Worked')), Field('seconds_holidays', 'integer', widget=SQLFORM.widgets.time.widget, requires=IS_SECONDS(), label=T('Time Holidays')), Field('seconds_total', 'integer', writable=False, compute=lambda row: row.seconds_worked + row.seconds_holidays) ) -- 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: Ansible Front-End
Hi Arnon and Chris, Have you managed to make any progress with web2py? I am about to embark on a similar project. On Tuesday, July 9, 2013 11:49:16 PM UTC+1, Christopher Steel wrote: We may be interested in this or something like it. I will run it by my partner. Chris On Tuesday, July 9, 2013 11:13:10 AM UTC-4, Arnon Marcus wrote: Ansible is a python-based deployment/configuration-management tool. http://www.ansibleworks.com/ There are already plans to ship such a web-based front-end at the end of the month. However, it's going to be proprietary, for payed-subscription only, and not based on web2py. I was thinking of starting-out an initiative of wiring a web2py app that would serve as a web-based front-end for ansible. The data in ansible is not written in a database, but in YAML files and jinja templates. It would have to read/re-write them. It would execute the ansible python-code itself. I found a project who tried to do this, but I think it's in ruby... http://mavimo.github.io/ansible-ui/hosts.html Anybody else interested in 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] Format dropdown list generated from a database table with OPTION helper
I would like to generate a dropdown list dynamically according to the records of a table, which refers to other tables. But it seems that lambda doesn't work with OPTION helper. For instance, I defined four tables, t_country, t_state, t_city, and t_birthplace. Table t_birthplace refers to those three tables, and I want the birthplace to be shown as country, state, city. The following is my code. In model: db.define_table('t_country', Field('f_name')) db.define_table('t_state', Field('f_name')) db.define_table('t_city', Field('f_name')) db.define_table('t_birthplace', Field('f_country','reference t_country'), Field('f_state','reference t_state'), Field('f_city','reference t_city'), format=lambda r: '%s %s %s' % (db(db.t_country.id == r. f_country).select().first().f_name, db(db.t_state.id == r.f_state ).select().first().f_name, db(db.t_city.id == r.f_city). select().first().f_name)) In controller: def index(): db.t_country.insert(f_name='US') db.t_state.insert(f_name='CA') db.t_city.insert(f_name='San Mateo') db.t_birthplace.insert(f_country=1,f_state=1,f_city=1) rows_birthplace = db(db.t_birthplace).select() # db.t_birthplace._format = '%(f_country)s' opts_birthplace = [OPTION(db.t_birthplace._format % row, _value=row.id) for row in rows_birthplace] form = FORM(SELECT(_name='sel_birthplace', *opts_birthplace)) return dict(form=form) In view: {{extend 'layout.html'}} {{=form}} I got error while running the above code: opts_birthplace = [OPTION(db.t_birthplace._format % row, _value=row.id) for row in rows_birthplace] TypeError: unsupported operand type(s) for %: 'function' and 'Row' But if I redefine the format, uncomment db.t_birthplace._format = '%(f_country)s' in controller, then the error is gone, the dropbox is generated, but the representation of the option is not what I wanted, it just shows 1, the id of f_country which refers to table t_country. How can I get the dropdown list that shows the name nicely like US, CA, San Mateo? Your suggestion is highly appreciated! -- 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] url rewriting and url mapping
My application is a clone of Reddit clone app from Massimo. This is the url I use to show all the posts in a category. http://127.0.0.1:8000/list_posts_by_votes/16 16 = category id I would like this url in place of. http://127.0.0.1:8000/my_category_name It's the same to show a post http://127.0.0.1:8000/view_post/1507 1507 = post id I would like this url in place of. http://127.0.0.1:8000/my_category_name/my_post_name Is it possible to do that with routes? I already add the routes.py in the root directory of web2py to simplify my url and use the language facilities. routers = dict( BASE = dict(default_application='my_app_name'), my_app_name = dict(languages=['en', 'fr'], default_language='fr'), ) Thanks for your 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.
Re: [web2py] Accesing table from external database
I don't get it. You can make DAL connection to SQL Server, what is the problem you can not? 2014-09-17 16:39 GMT-03:00 José Eloy pepe.e...@gmail.com: Hello! I need to populate a combobox in a FORM (or SQL FORM) with the content of a field of a table which is in an external SQL Server database. I know that is not possible to reference an external database using DAL, but how can I to load the content of the external field in a SQLFORM field (combobox)? Any idea? 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. -- Carlos J. Costa Cientista da Computação | BS Computer Science Esp. Gestão em Telecom | PgC Telecom Mangement º)) -- 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: show multiple buttons in SQLFORM
I finish to add my second button via jQuery jQuery( document ).ready(function() { jQuery(#submit_record__row .w2p_fw).append('{{=A(Markmin syntax,_class='btn btn-info',_href=http://www.web2py.com/init/static/markmin.html;, _target=_blank)}}') } Le dimanche 14 septembre 2014 14:18:13 UTC+2, olivier hubert a écrit : I have a simple FORM with a submit button and I want to add a second button to open a new window with Markmin info. I declare my form like that form = SQLFORM(db.comm, buttons=['submit', A(Markmin syntax,_class='btn',_href=http://www.web2py.com/init/static/markmin.html;, _target=_blank)]).process() But I see only the submit button and not the new one. If I remove the submit button from the form, the Markmin syntax button is showed and open a new window. -- 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] stdout and scheduler_run.run_output
Anyone have special knowledge of scheduler_run.run_output and best practice to capture stdout? My schedule process runs fine but I do not get all the output stored in scheduler_run.run_output. Its very intermittent. Sometimes I get partial stdout, sometimes nothing, sometimes it work fine. Strange thing is, I do see all the output in the web2py server instance terminal. I am running debian linux and my log function is just doing print() statement to stdout Thank you -- 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: Beginner issues
Thanks, I made it work with a custom validator. Cheers. Em quinta-feira, 11 de setembro de 2014 09h22min04s UTC-3, Pedro Henrique Correa Ferreira escreveu: Hey, lads! How you're doing? I've got a issue with data validation. I gotta use a validator that depends on a previous field from the same table, for example: db.define_table( 'driver', Field('your_age'), Field('years_as_driver'), #requires IS_INT_IN_RANGE (0,(your_age-18) Field('years_with_current_car'), #requires IS_INT_IN_RANGE (0, (years_as_driver +1) How is the correct way to do that? Thanks. -- 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] Changing The Default Start Application
How do I change the default start application from *welcome* to something like *library*. I am running a free www.pythonanywhere.com account for now, thanks. -- 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: set onblur event in controller
I generate the html table in controller. It has lots of rows and I assign name and id of each cell there. Also I bind each cell textbox _onblur event to a javascript function. When I have the function in the view itself it is working fine. But when I put the function in a .js file and append that file it is not working. What's wrong I don't know. Pl. help. On Monday, September 15, 2014 4:07:32 PM UTC+5:30, T.R.Rajkumar wrote: How to set the _onblur event of an INPUT in controller to a function in static/js/x.js file? -- 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 ajax call and Angularjs
Hi, I don't know angular to, but I found this documentation with a ajax sample at the end. http://slides.com/amberdoctor/angularjs_and_web2py Le mardi 16 septembre 2014 20:39:02 UTC+2, piero crisci a écrit : I am testing angularjs with web2py. In my web2py i have some ajax call that store the html code into a dialog box. Now i would like to insert in html code from the callback some angularjs code. But because ajax call is not into angular module , the code is not running. The angular MVC work instead properly into main pages. Anyone is trying the same thing or got some hints for me?. I cannot find any examples of how use web2py ajax (or jquer ajax) with angularjs -- 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] Suggestion to update trapped A links in components
I am trying to make an application that has the left hand menu created using one web2py component and the main view within the web page created using another component. I make the links in the menu on the left hand side using code like this: {{=A('linked page',_href='http://example.com/app/controller/func/action?1=param',cid=mainview)}} This then updates the main view with the relevant content supplied by the component (in my case the arg (action) and var (1=param) determine what content gets loaded into the 'mainview' element). However, the *data-w2p_remote* attribute on the *#mainview* element does not get changed to reflect the new location, so any form submission from the new page doesn't retain any parameters contained within the URL specified in the _href parameter in the example above. Can I ask (or suggest) that when a component is refreshed/reloaded that the *data-w2p_remote* attribute gets updated to reflect the new URL used to load that component? I think this would keep the client side DOM a little more consistent and keep behaviour as expected under the various ciircumstances.I did have a look in web2py.js to try and find the relevant part of the code, but I got lost trying to follow through the various functions involved :-) Thanks. -- 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] Changes to web2py.js - a bug(?) and request
Hi, My posts from 15th Sept didn't seem to get approval to appear in the forum, so I'm assuming this was an oversight and posting 2 of them again in a single post this time. I think there may be a bug in the web2py.js code (https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L263) The relevant code is shown below, the condition appears to miss the situation where the form has no action attribute at all (url === 'undefined') and so does not use the component url in this case. var url = form.attr('action'); if ((url === ) || (url === #)) { /* form has no action. Use component url. */ url = action; } I would suggest the code above is replaced with this: var url = form.attr('action'); if ((url === ) || (url === #) || (typeof url === 'undefined') { /* form has no action. Use component url. */ url = action; } This seemed to fix the problem I was experiencing with forms in a component. Also, I have been using this form of A helper (see code snippet below) in one of pages to update the content of a component, which works fine, however the 'data-w2p_remote' attribute of the component's DIV is not getting updated with the relevant URL used to update the content. {{=A('linked page',_href='http://example.com',cid=request.cid)} As a result, when a form gets loaded, the submitted form doesn't get sent to the original function with the correct request.args. Would it be possible to update web2py.js so that the component elements' 'data-w2p_remote' attribute get's updated. I think this would result in more consistent behaviour in ajax based applications. I have my own javascript code to do this for the time being, but it would be nicer to use web2py's own ajax code as this should take care of the intricate web2py ajax features. Thanks. -- 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: Web Editor Blank Screen
I'm having the as James upgraded from 2.8.2 to 2.9.9(11) now ...editor works fine on local dev box but on remote server running nginx the editor only allows viewing of new files. Seems I can edit old files, but not new. Any ideas??? On Tuesday, 8 April 2014 15:38:39 UTC-4, Derek wrote: That's what I thought, the web editor is actually running in an iframe, and without that header, the webpage just refuses to load... On Saturday, April 5, 2014 9:05:29 PM UTC-7, James Ryan wrote: Derek, thank you so much. Appending the line below that you suggested to /etc/apache2/apache2.conf has fixed it! Header always append X-Frame-Options SAMEORIGIN On Tue, Apr 1, 2014 at 5:44 AM, Derek sp1...@gmail.com wrote: also, make sure you have this line in your apache config... Header always append X-Frame-Options SAMEORIGIN On Monday, March 31, 2014 11:25:23 AM UTC-7, Derek wrote: The 'canceled' message can be caused by a few different routes, either a navigation away to a different page, a user clicking the 'stop' button, or an ad blocker... you should look at your network data to get better answers. http://dev.chromium.org/for-testers/providing-network-details There are other situations that chrome will cancel requests, such as the dom object which caused the request getting deleted, or another request going to the same server had an error (it will stop the request to prevent from getting another error). I'd hazard a guess and say it's likely a dom object getting deleted, but you'll have to investigate further. If this happens a lot with your RPI it could be an indication of the server returning an error (and chrome cancels pending requests). On Friday, March 28, 2014 7:18:38 PM UTC-7, James Ryan wrote: Hi guys, Having an issue with the web editor. Other's have experienced this problem before with no resolution: https://groups.google.com/forum/#!topic/web2py/fIuUAqdSieQ https://groups.google.com/forum/#!topic/web2py/SxYJX90zszY http://comments.gmane.org/gmane.comp.python.web2py/120843 I'm running web2py on a raspberry pi on the local network. I can access it fine, log into the admin interface, create a new app, and peek at the files. When I go to edit any files the page loads but the file doesn't. I've tried on multiple machines and browsers. The raspberry pi is headless and doesn't have xserver so I can't try locally. Using Chrome's debugger I can see the http request being cancelled and there's no response data in the header http://imgur.com/5HUd3cp http://imgur.com/wBPwRRl Looking at /var/log/apache2/access.log the http request returns 200 OK Any thoughts what this might be? -- 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+un...@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] compute and calculate database
I'm on the home stretch of my application. I want to know I sought but I can not find. from the database. I have this problem. db.define_table ('spot' Field ('analyse_des_besoins', 'double') analyse_des_besoins== 50 % Field ('patent', 'double') 'patent===10% Field ('marketing', 'double') marketing === 20% Field ('design', 'double') design==10% Field ('definition_du_projet', 'double') == 20% Field ('time', 'time'))==1h20 i must convert Field ('time', 'time')) in minute and then convert it in float to can calculate a percentage with each field ( Field ('analyse_des_besoins',Field ('patent',), Field ('marketing', 'double').. ) thank you -- 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: Deploying Web2py with nginx on FreeBSD
Thanks, Greg. I'm making progress. Now I'm getting an error from uwsgi 'Internal Server Error' on the web page. In the uwsgi.log '--- no python application found, check your startup logs for errors ---' On Sunday, September 14, 2014 5:29:17 PM UTC+1, GregD wrote: Have you tried changing the owner on the nginx location directory that's defined in your nginx.conf flie? Try making it the same owner that's defined in the nginx.conf file, which is typically, web-data. On Wednesday, September 10, 2014 11:03:13 AM UTC-5, myappeng...@gmail.com wrote: Hi, everyone. I'm in the process of deploying Web2py with nginx on FreeBSD. Does anyone have a deployment script for this configuration. All the recipes I have seen are for Linux and I'm having difficulties converting them for FreeBSD. I have installed nginx and uwsgi succesfully, but I get a permissions error [forbidden 403] when I web on to the nginx server. Many Thanks Mike This message is for named person(s) only. It may contain confidential and/or legally privileged information. No confidentiality or privilege is waived or lost should mis-transmission occur. If you receive this message in error, delete it (and all copies) and notify the sender. You must not, directly or indirectly,use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. GAD GROUP TECHNOLOGY, INC. reserves the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been virus and content scanned by GAD GROUP TECHNOLOGY, INC. -- 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] DAL error connecting to MySql
Hi all, yesterday just actualized my Ubuntu 14.04 and i get this connection errors on my web2py apps. type 'exceptions.RuntimeError' Failure to connect, tried 5 times: Traceback (most recent call last): File /home/jose/web2py/gluon/dal.py, line 8038, in __init__ self._adapter = ADAPTERS[self._dbname](**kwargs) File /home/jose/web2py/gluon/dal.py, line 700, in __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File /home/jose/web2py/gluon/dal.py, line 2749, in __init__ if do_connect: self.reconnect() File /home/jose/web2py/gluon/dal.py, line 680, in reconnect self.connection = f() File /home/jose/web2py/gluon/dal.py, line 2747, in connector return self.driver.connect(**driver_args) File /usr/lib/python2.7/dist-packages/MySQLdb/__init__.py, line 81, in Connect return Connection(*args, **kwargs) File /usr/lib/python2.7/dist-packages/MySQLdb/connections.py, line 187, in __init__ super(Connection, self).__init__(*args, **kwargs2) OperationalError: (1045, Access denied for user 'root'@'localhost' (using password: YES)) Checked conection on MySql Workbench and all fine. Any suggestions??? 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: ssl certificate?
This is not for web2py but for a non-profit that I help. Anyway, this is good to know. On Tuesday, 16 September 2014 13:37:04 UTC-5, Derek wrote: Free SSL Cert for Open Source projects... https://www.globalsign.com/ssl/ssl-open-source/ On Sunday, September 14, 2014 6:30:45 PM UTC-7, Massimo Di Pierro wrote: Any recommendation about where to buy a cheat ssl certificate? I have used RapidSSL before. -- 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: Making a DevBar to develop faster in web2py.
You would have to pass that information but mind that they may contain data that is sensitive and private. globals() contains all the global variables. db._timings is a list of (SQL, time) for all the queries. For the loading time look into window performance client-side: http://stackoverflow.com/questions/13045767/page-load-time-with-javascript On Tuesday, 16 September 2014 14:28:16 UTC-5, Encompass solutions wrote: I am working on a feature for web2py and would like to gather the following information: - How long did it take to render html for the page. - What database calls occured with this page render. - What were the calls that were made in SQL and DAL format. - What Global variables are set in the model. The idea I am working on is a bar that would render if locally run, or requested, that would display information about content sent to the page. Like the generic page but a little more informative and able to pulled up without interfering with the page at all. How would I get what I have stated above? Is there other content you would want for this DevBar, as I call it? I don't want to try to make my own firebug or anything, just stuff specifically about web2py's and the things that might be needed in making sure the page loads properly and developed quickly. Attached are my beginnings of it. It would pull out from the left with an html widget in the top right. Then selecting a tab on the right would load content on the left with the original page in the background. -- 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] How to get the host name in a scheduled function?
I have web2py running behind an apache server. If I ask for request.env.http_host I get my.domain.com - that is ok. But if I use request.env.http_host in a scheduled function I get 127.0.0.1:8000 Regards, Martin -- 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: Changes to web2py.js - a bug(?) and request
Hi, I'd suggest to set url='' to fix your problem. While for second problem you should set ajax_trap=True for the LOAD helper. See http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD-signature Paolo On Wednesday, September 17, 2014 9:09:47 PM UTC+2, Ide wrote: Hi, My posts from 15th Sept didn't seem to get approval to appear in the forum, so I'm assuming this was an oversight and posting 2 of them again in a single post this time. I think there may be a bug in the web2py.js code ( https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L263 ) The relevant code is shown below, the condition appears to miss the situation where the form has no action attribute at all (url === 'undefined') and so does not use the component url in this case. var url = form.attr('action'); if ((url === ) || (url === #)) { /* form has no action. Use component url. */ url = action; } I would suggest the code above is replaced with this: var url = form.attr('action'); if ((url === ) || (url === #) || (typeof url === 'undefined') { /* form has no action. Use component url. */ url = action; } This seemed to fix the problem I was experiencing with forms in a component. Also, I have been using this form of A helper (see code snippet below) in one of pages to update the content of a component, which works fine, however the 'data-w2p_remote' attribute of the component's DIV is not getting updated with the relevant URL used to update the content. {{=A('linked page',_href='http://example.com',cid=request.cid)} As a result, when a form gets loaded, the submitted form doesn't get sent to the original function with the correct request.args. Would it be possible to update web2py.js so that the component elements' 'data-w2p_remote' attribute get's updated. I think this would result in more consistent behaviour in ajax based applications. I have my own javascript code to do this for the time being, but it would be nicer to use web2py's own ajax code as this should take care of the intricate web2py ajax features. Thanks. -- 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.