[web2py] Multiple domains, one app
Hello, is it possible to build an app that handle multiple domains but totally different layouts. I'm thinking something like this: views/domain1/layout.html default/index.html .. views/domain2/layout.html default/index.html ... I made an table called site that contains domainname and domain_url and by matching domainname and request.env.host_name I get an domain_url from database. In every .html I have changed the {{extend "layout.html"}} to {{extend domain_url + "layout.html"}} The same can be done for static folder. I'm I doing this too complicated? Kenneth -- 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] How do I "SELECT * FROM table WHERE field IN (1,2,3,4,7)
Try db(db.table.field.belongs([1,2,3,4,7]) & (db.table.field2=="3)).select() db(db.table.field1.belongs([1,2,3,4,7]) & (db.table.field2=="3")).delete() Regards, Martin 2014-04-06 5:49 GMT+02:00 Kurt Jensen : > How do I do : > > "SELECT * FROM table WHERE field IN (1,2,3,4,7) AND field2='3'"" > > AND / OR > > "DELETE FROM table WHERE field1 IN (1,2,3,4,7) AND field2='3'" > > in web2py DAL? > > I come from PHP and I am really struggling with DAL in web2py. > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Web Editor Blank Screen
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 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+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] How do I "SELECT * FROM table WHERE field IN (1,2,3,4,7)
How do I do : "SELECT * FROM table WHERE field IN (1,2,3,4,7) AND field2='3'"" AND / OR "DELETE FROM table WHERE field1 IN (1,2,3,4,7) AND field2='3'" in web2py DAL? I come from PHP and I am really struggling with DAL in web2py. -- 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: Delete in SQLFORM.grid does not update number of records
Yes. Please open a ticket so we'll remember to fix it. On Saturday, 5 April 2014 18:21:35 UTC-5, horridohobbyist wrote: > > If I delete records in SQLFORM.grid, the number of records does not > change. Only if I explicitly refresh the browser page does the number of > records change. > > Have I found a bug? > > (I'm using web2py 2.9.4.) > -- 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] Delete in SQLFORM.grid does not update number of records
If I delete records in SQLFORM.grid, the number of records does not change. Only if I explicitly refresh the browser page does the number of records change. Have I found a bug? (I'm using web2py 2.9.4.) -- 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: Python 3 Migration
There is no Python 3 migration. Mind it is not a technical issue. web2py promises backward compatibility and we cannot port it to python 3 without breaking that promise. Almost none of the users have expressed an interest in helping moving existing code to Python 3. There will be some other framework based on web2py ideas, reusing some web2py code, hat may or may not look like web2py, that may or may not be called web3py, and it may or may not be similar to web2py. If you want to help you can help migrate dal.py and template.py (they should be made to work on both python2 and python 3). Massimo On Friday, 4 April 2014 02:46:18 UTC-5, Hi-tech Robert wrote: > > Hi, may I inquire about the status of python 3 migration? -- 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: passing table name as parameter
form = SQLFORM(db[request.get_vars.name]).process() anyway, make sure you validate access and the name variable. On Friday, 4 April 2014 00:13:17 UTC-5, Sharvil Katariya wrote: > > I want to basically pass URL?name='table_name' > > and create a form of the table name passed. > > but when i try to do db.table_name > i understand it will give me a error > as it will search for a table with table_name 'table_name' > > But I can't think of work around this problem... > > The code snippet in default.py is as follows: > > table_name=request.get_vars['name'] > form = SQLFORM(db,str(table_name)) > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Bad Request upload image in iPad/iOS to web2py server
It is a multipart yes. I was able to use request.body.read() to read the requests' body in other platforms. It looks ok, and everything works. I even changed from using FormData in javascript to writing my custom body and so on. It all works fine except in iOS. There seems to be some kind of problem reading the body. And I can't even know what is there, since the server raises the 400 BAD REQ whenever I try to access it I don't understand very well how xmlhttprequest works and so on, I am only sending text right now, would I be able to solve this problem by changing the content-type header? I tried text/plain but that didn't work as well On Friday, March 28, 2014 2:03:31 AM UTC, Massimo Di Pierro wrote: > > Is this a normal multipart post request? If not, perhaps you should use > request.body.read() and log what is in there. > > > On Thursday, 27 March 2014 07:48:39 UTC-5, ayresrichard wrote: >> >> >> I am developing a web browser application where the user must upload a >> image file to a web2py server. >> >> I am using the traditional way for file input, which, in the iPad, gives >> the option to either upload an existing picture or take a new one from the >> camera. >> >> var url = "http://please-help-me.com";; >> var file = document.getElementById("file").files[0]; >> >> >> var fd2 = new FormData(); >> fd2.append("upload", file); >> fd2.append("id", 123); >> >> >> var reader = new XMLHttpRequest(); >> reader.open('post',url, true); >> reader.onreadystatechange = function() { >> console.log("Status:" + reader.status); >> } >> reader.send(fd2); >> >> >> This works fine in the desktop browsers, Android browser, but not in the >> iPad, where it occasionally gives a 400 Bad Request Error. It doesn't >> return the error every time. Just sporadically. >> >> Web2py returns this error message: >> >> ERROR:Rocket.Errors.Thread-20:Traceback (most recent call last): >> File "/home/mdipierro/make_web2py/web2py/gluon/rocket.py", line 1337, >> in run >> File "/home/mdipierro/make_web2py/web2py/gluon/rocket.py", line 1838, >> in run_a >> pp >> File "/home/mdipierro/make_web2py/web2py/gluon/main.py", line 651, >> inapp_with >> _logging >> File "/home/mdipierro/make_web2py/web2py/gluon/main.py", line 532, >> inwsgibase >> File "/home/mdipierro/make_web2py/web2py/gluon/globals.py", line 252, >> in body >> HTTP: 400 BAD REQUEST >> >> >> Searching in the code, it appears the content of the post message is not >> valid and the web2py body function has trouble reading it. The error rises >> when I try to read the request.post_vars data >> >> I've tested the code without sending the image (and only sending other >> data) and it seems to be working every time. Is there a specific parameter >> I should add to the request? Why does it work sometimes, but not all the >> time? >> >> 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] passing table name as parameter
I want to basically pass URL?name='table_name' and create a form of the table name passed. but when i try to do db.table_name i understand it will give me a error as it will search for a table with table_name 'table_name' But I can't think of work around this problem... The code snippet in default.py is as follows: table_name=request.get_vars['name'] form = SQLFORM(db,str(table_name)) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] SMARTGIRD is it possible to have a lambda function in LINKED_TABLES?
Hello, I'd like to give access to a subtable only if there is something to see in it (this is of course depending on the main table). So, I tried this which does not... myform = SQLFORM.smartgrid(db.my_main_table, linked_tables=dict(my_main_table= *lambda row:* ['my_sub_table'] if *my_counting_function*(row.my_main_table.id) > 0 else ['']) *my_counting_function* just returns 1 if I have at least one depending record in my_sub_table, else 0. Thanks in advance for any suggestion to correct my synthax (I'm a newby with web2py) or for any turnaround. Serge -- 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 embed a d3.js script in a view correctly?
Hi Sihui, Just add a div with an id after extend layout and then select this id from d3. If you select "body" and append a circle it will go at the bottom of the page. {{response.files.append(URL(r=request,c='static',f='/js/d3.js'))}} > {{extend 'layout.html'}} > > > > > d3.select('#mychart').append('svg').append('circle').style("stroke", > "gray").style("fill", "red").attr("r", 40).attr("cx", 50).attr("cy", 50); > > > -- 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: Install in hostgator
You got it to work! How did you do it? What was wrong with it? http://moneytweak.com/welcome/default/index On Monday, March 10, 2014 5:21:42 AM UTC-7, Mạnh Trần Đức wrote: > > I 've bought Hatchling package hosting on hostgator. > I tried install web2py on subfolder public_html/web2py but it was not > successful. > Server response 500 default status of hostgator: > http://moneytweak.com/web2py/ > > This is my .htaccess and index.fcgi in web2py folder: > ###.htaccess: > AddHandler fcgid-script .fcgi > Options +FollowSymLinks +ExecCGI > RewriteEngine On > RewriteBase /web2py/ > RewriteRule ^index\.fcgi/ - [L] > RewriteRule ^(.*)$ index.fcgi/$1 [L] > > ###index.fcgi: > #!/home/user/env/bin/python > import sys, os > sys.path.append('/home/user/public_html/web2py') > os.chdir('/home/user/public_html/web2py') > from flup.server.fcgi_fork import WSGIServer > import gluon.main > application=gluon.main.wsgibase > # or > # application=gluon.main.wsgibase_with_logging > WSGIServer(application).run() > > ###routes.py > default_application = 'init'# ordinarily set in base routes.py > default_controller = 'default' # ordinarily set in app-specific routes.py > default_function = 'index' # ordinarily set in app-specific routes.py > routes_in = (('/web2py/(?P.*)','/\g'),) > routes_out=(('/(?P.*)','/web2py/\g'),) > logging = 'debug' > > Can anybody help me, plz? -- 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: New Windows Vista Install problem
I have just tried to run this version... Now it's working fine on my Windows Vista. Thanks 2014-03-29 23:08 GMT+01:00 Massimo Di Pierro : > Can you please try the latest nightly build? > > http://web2py.com/examples/static/nightly/web2py_win.zip > > > > On Friday, 28 March 2014 14:06:37 UTC-5, egigi wrote: >> >> >> >> Il giorno venerdì 28 marzo 2014 19:35:51 UTC+1, Dave S ha scritto: >>> >>> >>> >>> On Thursday, March 27, 2014 2:41:14 PM UTC-7, User wrote: Did you install web2py source version or web2py_win.zip? What python version are you using? And when you "run" it, what are you doing specifically? On Wednesday, March 26, 2014 4:51:30 PM UTC-4, ian james wrote: > I have installed Win2py on my Vista laptop. (My laptop video hardware > is not supported on windows 7) > > When I run Win2py, the CMD window flashes on my screen and then > disappears. I have had this problem with a previous Python install years > ago. However, the PY application opens a CMD window and seems to run a > Python interpreter, so Python does not seem to be the problem. > > Any suggestions on what to check? > >>> "User" asks some good questions, but note that there were recently some >>> issues in packaging the release for Windows and Mac (web2py_win.zip, for >>> instance). This has been fixed in the latest night builds since about a >>> week ago, so you might try going to the downloads page for that, or >>> getting an older release. >>> >>> /dps >>> >>> -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/B0BFmf6H3Jc/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] Python 3 Migration
Hi, may I inquire about the status of python 3 migration? -- 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: Help defining architecture for app
I have not tuned Apache nor Postgres, their both vanilla installs through APT. I don't have the top or iostat output right now, I will simulate the load tomorrow that users don't work on the app and post back on monday. I will also enable PostgreSQL statistics and post them too. Thanks for the help. El viernes, 4 de abril de 2014 21:14:32 UTC-6, LightDot escribió: > > On Friday, April 4, 2014 7:14:39 PM UTC+2, Francisco Betancourt wrote: >> >> Hello LightDot >> >> Thanks for the interest in my post, hope we can come up with a way to >> improve performance. This is my current setup: >> >> >>- Host: Digital Ocean (and yes I do think their Droplets (as >>instances are called) are KVM) >>- OS: Ubuntu 13.04 >>- Web Server: Apache 2.2 >>- Database: PostgreSQL 9.1 >>- Memory usage in peak times is about 1.4GB (out of 2GB) >>- By the way I have no swap partition >>- I don't know how to count db connections, but in my db definition I >>used the poolsize=50, but again I don't know how to check the amount of >>connections at any given time >>- Disk usage acording to Digital Ocean metrics is medium never high >>(do truly I have never understand their graph) >>- CPU usage at some points gets close to 50% (since this a dual core >>I would assume one of the cores is at 100%) >> >> I don't know what else to mention but, if I missed anything please ask. >> And thanks again. >> > > This is good information to start with. Do you have more statistics, such > as top and iostat output at the peak times, etc. ? > > Postgresql itself has statistics available, for example see > http://www.postgresql.org/docs/9.1/static/monitoring-stats.html > > Did you already tune apache or postgresql in any way? if so, what are your > settings..? On the web2py side and for your current use case, the > poolsize=50 setting might be ok or not, depending on your apache/pg setup... > -- 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 run web2py from App Engine Launcher
Use trunk. We made some changes to fix appengine problems. Will release a 2.9.6 soon. It allows: web2py.py -G Which configures appending (app.yaml and gaehandler.py) for you. On Friday, 4 April 2014 19:54:03 UTC-5, gubbanoa wrote: > > I'm trying to run web2py 2.9.5 from Google App Engine Launcher 1.9.2 on > Windows. After modifying the app.yaml file to suit Python 2.7, I got an > error message about missing gaehandler.py and, after searching the forum > for a solution, copied that file into the main web2py directory. However, > now I get "ImportError: No module named gluon.settings". I saw a previous > question about this, but no answer. I'm just trying to run web2py locally, > not deploying at this stage, and I'm only trying to run the default > (Welcome) application. Do I need a routes.py file to do this? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Need a developer. Seattle Wa
http://blogs.cisco.com/security/introducing-kvasir/ El viernes, 4 de abril de 2014 05:59:22 UTC, Brando escribió: > > It's pretty easy to find Django developers out there; however, I can't > seem to find web2py devs. I have an upcoming project to build an app for > data entry and report generation for security audits (penetration testing). > I need a developer who can help me build out the code base and is familiar > with ajax/jquery data entry. > > Can someone point me in the right direction? > -- 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: Need a developer. Seattle Wa
there is a web2py project built by cisco for Penetration Test Data Management https://github.com/KvasirSecurity/Kvasir El viernes, 4 de abril de 2014 05:59:22 UTC, Brando escribió: > > It's pretty easy to find Django developers out there; however, I can't > seem to find web2py devs. I have an upcoming project to build an app for > data entry and report generation for security audits (penetration testing). > I need a developer who can help me build out the code base and is familiar > with ajax/jquery data entry. > > Can someone point me in the right direction? > -- 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] Multiple tables select
So I have this tables: if not "board" in db.tables: db.define_table("board", Field("title", label=T('Title')), Field("description", 'text', label=T('Description')), auth.signature, format = "%(title)s" ) if not "text_type" in db.tables: db.define_table("text_type", Field("title", label=T('Title')), Field("body", 'text', label=T('Content')), Field("board", 'reference board', label=T('Board')), auth.signature, format = "%(title)s" ) if not "url_type" in db.tables: db.define_table("url_type", Field("url", label=T('URL')), Field("board", 'reference board', label=T('Board')), auth.signature, format = "%(title)s" ) if not "image_type" in db.tables: db.define_table("image_type", Field("upload_image", 'upload', label=T('Upload Image')), Field("board", 'reference board', label=T('Board')), auth.signature, format = "%(title)s" ) if not "video_type" in db.tables: db.define_table("video_type", Field("url_video", label=T('Video URL')), Field("board", 'reference board', label=T('Board')), auth.signature, format = "%(title)s" ) All the four last tables have a common field that references board. Now I need to select all the records of this four tables that reference the same board and sort them by the created_on field, like: board_id = int(request.args(0)) topics = db((db.text_type.board == board_id)&(db.image_type.board == board_id)&(db.video_type.board == board_id)...).select(orderby=db.table.created_on) But it doesn't work and I don't understand why. -- 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: Question about Web2py inner workings
On Friday, April 4, 2014 5:51:11 PM UTC-4, Cliff Kachinske wrote: > > If I write a python module like this: > > # born_to_fail.py > foo = 'bar' > def main(): > print foo > if __name__=='__main__': main() > > The above shouldn't produce an error, but the following will: foo = 'bar' def main(): print foo foo = 'foo' In the above, the assignment to foo indicates foo is a local variable (since it hasn't been explicitly declared as global), so the previous print statement raises an exception because it refers to a local variable that has not yet been declared. In your original example, because there is no assignment to foo within the function, the foo in the print statement is assumed to be global, and there is no exception because foo is in fact a global variable. 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] What does this timeout error in pg8000 mean?
Versionweb2py™Version 2.9.5-stable+timestamp.2014.03.16.02.35.39PythonPython 2.7.5: /usr/bin/python (prefix: /System/Library/Frameworks/Python.framework/Versions/2.7)Traceback 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. Traceback (most recent call last): File "/Library/Server/web2py/gluon/main.py", line 539, in wsgibase BaseAdapter.close_all_instances('rollback') File "/Library/Server/web2py/gluon/dal.py", line 600, in close_all_instances db._adapter.close(action) File "/Library/Server/web2py/gluon/dal.py", line 580, in close getattr(self, action)() File "/Library/Server/web2py/gluon/dal.py", line 1923, in rollback return self.connection.rollback() File "/Library/Server/web2py/gluon/contrib/pg8000/dbapi.py", line 455, in _fn return fn(self, *args, **kwargs) File "/Library/Server/web2py/gluon/contrib/pg8000/dbapi.py", line 551, in rollback self.conn.rollback() File "/Library/Server/web2py/gluon/contrib/pg8000/interface.py", line 622, in rollback self._rollback.execute() File "/Library/Server/web2py/gluon/contrib/pg8000/interface.py", line 166, in execute self.c.close_portal(self._portal_name) File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1326, in close_portal reader.handle_messages() File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 906, in handle_messages msg = self._conn._read_message() File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1033, in _read_message bytes = self._read_bytes(5) File "/Library/Server/web2py/gluon/contrib/pg8000/protocol.py", line 1021, in _read_bytes self._sock_buf = self._sock.recv(1024) timeout: timed out -- 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.