[web2py] web2py.com is down
I could get onto www.web2py.com yesterday or today, is this the right place to report 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] Check to delete glitch in 2.9.6 and 2.9.7
I have 2 applications which both seem to have a problem with the 'check to delete' option in 2.9.6 and 2.9.7. The 'check to delete' label on this tick box is now showing up as 'Check to deleteNone'. I don;t think it did this when I was using 2.9.5, although that was a few months ago now, so I may not remember fully. In both cases I am using the SQLFORM feature with the deletable=True option and {{=BEAUTIFY(form)}} in the view. I have done a quick search in the sqlhtml.py code, but there is no obvious typo in there to account for it, so it seems like the None is getting added on to this label somewhere along the line. My resulting html from the {{=BEAUTIFY(form)}} code is as below Check to deleteNone Any ideas what could be casuing 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] Re: a proposal for form improvement
I like the idea of a slimmed down equivalent of SQLFORM. However, I think it should be written to permit client side rendering via js scripts, or server side rendering in views; as such the output as json or python object/array would be ideal. Personally I prefer python to javascript so would render server side myself. I do think SQLFORM offers useful features but I sometimes end up discarding all the generated html to use my own custom view, which means wasted processing time on the server. Being able to use the JForm output in my own web2py view would be useful. This is a shift in emphasis which is needed to support the trend for more client side ui processing, so I am in favour. I think the way it works should be clear and well documented, for those wishing to use it and those wishing to remove it from the client side libraries loaded by default. I sometimes find it hard enough as it is to figure out what happens when and where in the existing web2py client side javascript, so adding more may add to the confusion. What are the implications for component forms interactively loaded and posted, how would the client side javascript handle these cases? Will code end up being duplicated in the bootstrap version and the non-bootstrap version? If so will this increase the chances of inconsistencies slipping in? On Friday, September 5, 2014 6:56:23 AM UTC+1, Massimo Di Pierro wrote: > > Please find attached a welcome4.zip with contains the following files: > > controllers/default.py > views/layout.html > vides/default/index.html > modules/jform.py > static/js/jform.js > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js > > My proposal is the following: > 1) deprecate SQLFORM (but keep it for backward compatibility) > 2) replace > > form = SQLFORM(table).process() > ... > {{=form}} > > with > > form = JForm(table) > ... > {{=form}} > > what is the difference? SQLFORM generates html. JForm generates JSON > metadata which is then converted into the form client-side by the js in > jform.js. > why? > - it is much faster because all rendering is done client-side > - it can "optionally" submit the form via Ajax without having to change > your code. > - it is much easier to style and create widgets for different css > frameworks. > For example include the right one: > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3) > - it is much more powerful because you can customize widgets in JS. > > We could also add a JTable, a JMenu and a JLogin and keep all the styling > info in JS files as opposed to Python files. > This would make web2py leaner and cleaner. > > Thoughts? > > 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: Check to delete glitch in 2.9.6 and 2.9.7
Great, fixed on my server 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] Anyone else having problem with delete icon in 2.9.7?
I am finding that the delete icon in the admin interface opens the file (image) or downloads the file (text file) rather than giving the option to delete. The url seems to be correct, I see the delete function within the URL. Does anyone else see this problem? 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: a proposal for form improvement
I admit I haven't looked at this files, but these are my thoughts on the general concept, so apologies if some of these comments don't directly reflect your exact proposal. I like the idea of a slimmed down form generation process on the server, and there is a trend to greater rendering on the client side which this will help, whatever client side tools are used. I would prefer any new option to be able to generate json or a python object, so we can choose to render in the web2py views or client side as we wish. Personally, I like web2py because of python, and much prefer writing python code to javascript code, but often feel SQLFORM does a bit too much when I want to control the form layout more. I think the client side javascript rendering in general presents the following challenges: - javascript code itself is not as easy to read as python - it's much harder finding out what javascript does what and when on the client side, especially when a few different scripts and libraries are involved. - client side rendering can take time and things can look a bit messy until it is completed - extra work is need to keep track of the current state of the client side interface and allow bookmarks to the current state In particular adding more client side rendering in web2py in this way may have the following issues: - there are still a lot of different javascript libraries developing client side ui functionality, would web2py's own way of doing this get in the way? - separate code depending on whether you are using bootstrap, or some other layout system would involve duplication and more chance of bugs wouldn't it? - how will this affect forms within components? And what about when components are reloaded? On Friday, September 5, 2014 6:56:23 AM UTC+1, Massimo Di Pierro wrote: > > Please find attached a welcome4.zip with contains the following files: > > controllers/default.py > views/layout.html > vides/default/index.html > modules/jform.py > static/js/jform.js > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js > > My proposal is the following: > 1) deprecate SQLFORM (but keep it for backward compatibility) > 2) replace > > form = SQLFORM(table).process() > ... > {{=form}} > > with > > form = JForm(table) > ... > {{=form}} > > what is the difference? SQLFORM generates html. JForm generates JSON > metadata which is then converted into the form client-side by the js in > jform.js. > why? > - it is much faster because all rendering is done client-side > - it can "optionally" submit the form via Ajax without having to change > your code. > - it is much easier to style and create widgets for different css > frameworks. > For example include the right one: > static/js/jform-bootstrap2.js > static/js/jform-bootstrap3.js (I only provide a layout for bs2 and not bs3) > - it is much more powerful because you can customize widgets in JS. > > We could also add a JTable, a JMenu and a JLogin and keep all the styling > info in JS files as opposed to Python files. > This would make web2py leaner and cleaner. > > Thoughts? > > 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: Anyone else having problem with delete icon in 2.9.7?
Since posting this, I suspect this may be because I am now using nginx to serve up static content. The example nginx configurations in the deployment recipes would appear to also match the url used for the delete action, and so nginx is treating this as static content. I just happened to only try this on static content during my testing :-) If I wish to do app admin behind a nginx server, it would seem I will need to exclude the admin application from the nginx served static content. On Saturday, September 6, 2014 12:01:41 AM UTC+1, Ide wrote: > > I am finding that the delete icon in the admin interface opens the file > (image) or downloads the file (text file) rather than giving the option to > delete. The url seems to be correct, I see the delete function within the > URL. > > Does anyone else see this problem? > > 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: a proposal for form improvement
> > Personally I prefer python to javascript so would render server side >> myself. >> > > Keep in mind that with the new system, you won't necessarily have to write > Javascript -- the Javascript that renders the forms will be provided by the > framework. > I am thinking of those occasions where the default rendering doesn't suit my needs. For example the table layout doesn't work when I wish the labels to go above the form fields, so in these situations I have a custom form view. > > >> I do think SQLFORM offers useful features but I sometimes end up >> discarding all the generated html to use my own custom view, which means >> wasted processing time on the server. >> > > Note, if you don't do {{=form}} in the view, then the form is never > serialized into HTML (though the server-side DOM is created, so there is > still some waste if you're not using any of the HTML or widgets). > I didn't know that. Thanks for pointing this out. If I define custom forms using: {{=form.custom.widget.name}} for example, does the whole form get serialised then, or just the relevant widget? -- 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] 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.
[web2py] Re: Changes to web2py.js - a bug(?) and request
Paolo, Thanks for responding. I think you may misunderstand the issue with the first problem I describe. The code I have shown is part of the trap_form function included in web2py.js, not my own code. If the form doesn't have an action attribute set, then url does not get defined. It seems sensible to me for web2py.js to use the component URL in such a case, and would make the trap_form behaviour a little more robust. For my second issue the original component is already loaded with ajax=True and ajax_trap=True. The problem is when I use a link generated by the A helper as suggested here: Trapped-Ajax-links-and-the-A-Helper <http://web2py.com/books/default/chapter/29/12/components-and-plugins#Trapped-Ajax-links-and-the-A-Helper>. Now this link is in the main page, and I am trying to use it to update a component that has already been loaded, but the new content has an extra argument added on the the URL. For example: The original component is loaded from http://example.com/myapp/myfunc.load, the trapped link refreshes this same component using /myapp/myfunc.load/test/ where test is the first argument (request.arg(0)), this will load a form. For my form submit to work, the new component url (as stored in data-w2p_remote) should now be /myapp/myfunc.load/test. As data-w2p_remote does not get updated when the trapped link is clicked my form gets submitted to /myapp/myfunc.load and so is missing the first argument that was available when the form was generated. Now I know I can get around this by explicitly setting the form's action attribute etc, but I think this is a work around and adds extra code, when a more elegant solution is possible. I propose that when trapping the link in this way, that the data-w2p_remote should be updated, as this should represent the source of the current content of the component, not the original content. By not updating data-w2p_remote attribute, the client side DOM is now inconsistent in my opinion. Regards, Ide. -- 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
Massimo, I have opened two tickets (#1986 and #1987) as these are two separate issues. I guess I should have done this first, but I hadn't looked at the issues list before. Thanks., Ide. On Saturday, September 20, 2014 7:00:31 PM UTC+1, Massimo Di Pierro wrote: > > Please open a ticket about this. > > On Wednesday, 17 September 2014 14:09:47 UTC-5, 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.
[web2py] web2py as a separate admin process?
I am working on a web2py application to help with FreeBSD system administration. Although my main web2py system will run with Nginx and uWSGI on this server, I would like my admin app to run independently of these as I would use the admin application to manage these configurations and a bad config could lock me out if the admin application depended on Nginx and uWSGI. I was thinking xinetd would be a good solution as it would only run when required, and can be restricted to specific source IP addresses which would be good for security. My first attempt at this failed (I tried to adapt this guide: http://www.freebsdonline.com/content/view/883/531/, replacing the server parameter with the path to python, and the arguments with the web2py.py plus usual startup options which work find on their own). Has anyone managed to run web2py from xinetd or inetd? Any other suggestions other than just running web2py with it's built in web server as a service? Security is important as some of the tasks require root access, so any extra layer of security would be good. How secure is the built in web2py web server? I'm trying to keep it simple and lightweight as it would be hosted on a single core virtual server. Thanks, Ide. -- 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.