Re: [web2py] Re: Sticky sessions in a distributed environment
Right. Then why does the whole ticketting system depend on admin ? It is even said in the Deployment Recipe chapter of the doc http://www.web2py.com/books/default/chapter/29/13/deployment-recipes#Collecting-tickets : You can later view the errors *using the admin app*, clicking on the switch to: db button at the top, with the same exact functionality as if they were stored on the file system. Same goes for appadmin.py and its permission-based manage feature which is described as a role-based database access. Why would you define roles in a local environment ? Obviously this is meant to go on production in a secure back-office... Admin is designed as more than a testing tool for a local or development environment, yet it is not meant to be deployed on production. I now get why many blogs and forums discussing web2py vs other framework always end up mentionning that developping on web2py starts as a very thrilling experience but often leaves a bitter taste. On Wednesday, November 26, 2014 8:48:49 PM UTC+1, Niphlod wrote: I agree, but let us remind that the admin app is not meant to be deployed anywhere in production: its probably the reason why the corner-case surfaced now instead of some time ago. -- 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: multiple select plugin and list reference
apparently I did something diffrent back than. Now its working. Thanks On Tue, Nov 25, 2014 at 6:55 PM, Leonel Câmara leonelcam...@gmail.com wrote: This is working fine for me. db.define_table('fruit', Field('name'), ) db.define_table('cocktail', Field('fruit','list:reference fruit'), ) from plugin_multiselect_widget import ( hmultiselect_widget, vmultiselect_widget, rhmultiselect_widget, rvmultiselect_widget, ) db.cocktail.fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'fruit.id','%(name)s', multiple=True)) db.cocktail.fruit.widget = hmultiselect_widget I just put that in the models with the plugin in the modules folder, then I inserted some fruit and cocktails in appadmin. Everything worked correctly. This is basically the same thing you're doing right? Can you open the console and check for javascript errors? -- 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/_wpkQivld-Q/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.
Re: [web2py] Re: multiple select plugin and list reference
I think I was a little quick to write it works. The multiple select shows but the entries won't move to the second box. So no function of the widget at all. How do I open up the console to check for javascript errors? On Fri, Nov 28, 2014 at 11:55 AM, Kevin Bethke kevin.bet...@gmail.com wrote: apparently I did something diffrent back than. Now its working. Thanks On Tue, Nov 25, 2014 at 6:55 PM, Leonel Câmara leonelcam...@gmail.com wrote: This is working fine for me. db.define_table('fruit', Field('name'), ) db.define_table('cocktail', Field('fruit','list:reference fruit'), ) from plugin_multiselect_widget import ( hmultiselect_widget, vmultiselect_widget, rhmultiselect_widget, rvmultiselect_widget, ) db.cocktail.fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'fruit.id','%(name)s', multiple=True)) db.cocktail.fruit.widget = hmultiselect_widget I just put that in the models with the plugin in the modules folder, then I inserted some fruit and cocktails in appadmin. Everything worked correctly. This is basically the same thing you're doing right? Can you open the console and check for javascript errors? -- 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/_wpkQivld-Q/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: Sticky sessions in a distributed environment
I now get why many blogs and forums discussing web2py vs other framework always end up mentionning that developping on web2py starts as a very thrilling experience but often leaves a bitter taste. You could have suggested that we make admin more production ready than it already is, maybe even contribute towards it, instead you make a cheap jab. Are you 12 or something? -- 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] autofill noneditable field in SQLFORM.grid
Hello I have a SQLFROM.grid and some fields are not editable but the value is calculated based on two other fields a user inserts and should be seen for user after he inserts the values for them e.g.: start time : 9:00 --user inserts end time : 11:00 --user inserts duration: 2:00 - calculated and non editable field any suggestion? 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.
Re: [web2py] autofill noneditable field in SQLFORM.grid
You would need to write JavaScript code to get that done. Kiran Subbaraman http://subbaraman.wordpress.com/about/ On Fri, 28-11-2014 5:15 PM, Yebach wrote: Hello I have a SQLFROM.grid and some fields are not editable but the value is calculated based on two other fields a user inserts and should be seen for user after he inserts the values for them e.g.: start time : 9:00 --user inserts end time : 11:00 --user inserts duration: 2:00 - calculated and non editable field any suggestion? 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 mailto: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: Sticky sessions in a distributed environment
I don't think commenting about my age is any more mature than what you claim I would be... Anyway, contributing is amongst my current preoccupations - as I mentionned in another post. The thing is : my disappointment here lies in the architecture, not the features. There is little contribution to be done when regarding an architectural issue (except a big refactoring of course, which you can't expect a regular contributor to do on his own). Web2py provides a lot of features, and they are supposed to be adapable and easy to include with your own application. In many ways, I find this is not true. My personal experience is that I put a lot of time and effort to try and work as close to web2py as I could, and now when I try to make my app evolve I end up either cutting from web2py (i.e. rebuilding the whole feature with custom code instead of using web2py's) or deleting the feature altogether. Perhaps web2py is too feature-intensive to be truly adaptable, perhaps it is too education-oriented to work quite well in other domains (mine would be e-commerce)... I think it is fair to share personal experiences regarding the framework (good or bad), as long as they are relevant. On Friday, November 28, 2014 12:15:57 PM UTC+1, Leonel Câmara wrote: I now get why many blogs and forums discussing web2py vs other framework always end up mentionning that developping on web2py starts as a very thrilling experience but often leaves a bitter taste. You could have suggested that we make admin more production ready than it already is, maybe even contribute towards it, instead you make a cheap jab. Are you 12 or something? -- 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's included connection pooling VS external pooling software
I go back to this thread because today I ran with the same problem: postgresql reaching max_connection limits and, therefor, some of my websites throwing intermitent HTTP 500 errors (because web2py couldn't connect to the database). To remind, we are talking of a VPS with multiple instances of web2py running, all of them serving the same web2py app, each one connecting to a different postgresql database (however the database structure is the same accross all the databases). Each web2py instance is served by a lighttpd virtual host through fastcgi. Each virtual host (that is, each web2py instance) receives a different volume of traffic (that is obvious, they are different websites with different public). The original problem (the one that caused I post this question in the first place) was that the postgresql database server was reaching the max_connections limit and, in consecuence, some of the websites were throwing intermitent HTTP 500 errors (web2py couldn't connect to database). Then, the user oriented me with pool_size parameter of DAL constructor. Thanks again! I've been reading the web2py documentation about pooling [1] and I notice that it says that When the next http request arrives, web2py tries to recycle a connection from the pool and use that for the new transaction. If there are no available connections in the pool, a new connection is established. So, if I didn't get it wrong, I deduce that with web2py's pooling mechanism I can't overcome the max_connections postgresql limit. That is because, no matter the size of the pool, if the pool is full and the website is receiving a lot of requests, new connetions will be created, and eventually the database server will reach the max_conectios limit. So, I read about pgBouncer [2], with special attention to the configuration parameter max_client_conn [3]. Also I've found this two posts [4] [5] explaining that this parameter can be set in **any** number, independently of the max_connections postgresql configuration. Therefor, ¿is it ok to say that web2py's pooling mechanism **won't** let you overcome postgresql max_connections limit, but in the other hand, you **will** be able to overcome that limit using pgbouncer? Thanks in advance. [1] http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Connection-pooling [2] https://wiki.postgresql.org/wiki/PgBouncer [3] http://pgbouncer.projects.pgfoundry.org/doc/config.html [4] http://stackoverflow.com/questions/18061541/pgbouncer-on-large-client-connections [5] http://stackoverflow.com/questions/26844635/multi-process-pgbouncer-pooling-out-of-available-connections El martes, 28 de octubre de 2014 16:55:42 UTC-3, Niphlod escribió: theoretically a db = DAL(, pool_size=5) will create AT MOST 5 connections to that db. you have 20, so any app's instance will create AT MOST 20 connections to the db. if you postgres accepts AT MOST 50 connections, you'll reach the top at 2 apps and a half. As for the ram consumed by postgres, it's a setting too. Of course if you have 4 gb of ram, 1.5 assigned to postgres seems normal (if not too conservative). Most db engines (postgresql included) benefit in any operation if more ram is available. -- 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: Sticky sessions in a distributed environment
Any project will eventually outgrow any framework it uses, when that happens you can either contribute to the framework if it makes sense or just do it yourself for that application. The advantage is that with web2py you can use the included tools while you don't reach that moment while with a more bare-bones framework you don't even get that option. I think it is fair to share personal experiences regarding the framework (good or bad), as long as they are relevant. Sure, but keep it technical. -- 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] Domain model and web2py DAL
Hi. I'd like to use the domain model pattern and keep database access code outside models. It seems to me that using a simple database abstraction layer such as web2py DAL better fits to transaction script (no domain models or anemic domain model - models reflect tables) or active records (models have data, logic and data access) design patterns. It seems to me that using a full domain model fits better with the data mapper pattern and probably I should use an ORM. You agree? How you usually embed web2py HAL into your application (from an architecture perspective)? -- 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: Upload file using POST
Hi, I have this weird scenario in which i have to send the filename in the query parameter like this: 'host' : wpvr_variables.ajaxurl + '?action=wpvr_upload_file' + 'filename=recorded_file' + wpvr_variables.post_id, but it is only taking the first parameter action from the url and discarding the filename as i know this is a post request it will behave like that but i really want the filename from the host as i want to use it in the function specified by action. Please if any one can help me find an alternative, i would be very glad. Thanks in advance, Parth -- 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: Java Client for web2py SOAP web service
I can make the client work if using python suds and pysimplesoap. But when I use JAVA-WS client, I always got the error: javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://aa.bb.cc.dd//default/call/soap?WSDL. It failed with: Got java.security.cert.CertificateException: No subject alternative names present while opening stream from https://aa.bb.cc.dd//default/call/soap?WSDL. Here aa.bb.cc.dd is a public ip address. The web2py application is host on amazon EC2. Thanks! On Monday, November 24, 2014 3:24:25 PM UTC-5, Pengfei Yu wrote: Hi Dave, Thanks very much for your reply! Could you give a more detailed example for an implementation for Java client? A block of java codes from your Java client talking to web2py service will be perfect. Even with the most simple example from the web2py's SOAP service document is good enough. Thanks! On Friday, November 21, 2014 6:16:45 PM UTC-5, Dave S wrote: On Thursday, November 20, 2014 6:49:18 AM UTC-8, Pengfei Yu wrote: Hi, I am using the SOAP service provided by web2py to create a simple web service for my web application. The document provide a example of using pysimplesoap to consume the created SOAP web service. The code is like below: from gluon.contrib.pysimplesoap.client import SoapClient client = SoapClient(wsdl=http://localhost:8000/app/default/call/soap?WSDL;) print client.MyAdd(a=1,b=2) {'result': 3} My question is for this simple web service, can we use other languages like JAVA to consume it in the client side. Does the simple web service allow JAVA clients like JAX-WS or JAVA Axis to access it? My cooperator want me to create a web service for my application and they are using JAVA. I have a Java client talking to my Web2Py service. My imports include javax.xml.soap.xml, and i instantiate using SOAPConnectionFactory. I also have a Python client that talks to the same service using suds rather than pysimplesoap, so I would expect any typical client library to work. Mariano seems to have a very good library for us to leverage. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Getting a form field to return var on select
Hi, I saw a discussion begin on this subject on Stackoverflow but can't find the continuation here. I have a case where I need to use the input in one form field (eg portfolio) to filter options of the IS_IN_SET constraint for a subsequent form field (eg sector/industry). I'm pretty new to web2py and jquery. How would I go about implementing this? 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: web2py RESTful timeout
Thanks I'm testing this now. I'll let you know if it works. On Monday, November 24, 2014 10:04:56 AM UTC-7, Derek wrote: If you don't need sessions for those requests, you should disable sessions first and see if that works better. Sessions kills concurrency. On Friday, November 21, 2014 8:36:36 AM UTC-7, Bart wrote: I have a python script that posts data to my web2py/application/projects database using RESTful services. Everything works fine for an hour or two, but then all future posts will timeout. If, using a web browser, I reload the web2py application's main page then the RESTful services start working again for another hour or two. Any ideas why I cant run a script 24/7 to GET/POST data to my web2py application's RESTful services? -- 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] Built-in web2py Wiki, wrong URL with Apache 2.4 mod_proxy
Hi I use the built-in web2py Wiki. It works create without mod_proxy configuration. If I use mod_proxy with Apache I get wrong URL for the uploaded media files (png graphics etc.). My Apache virtual host file: VirtualHost *:80 ServerAdmin webmas...@myserver.ch ServerName raffael.myserver.ch Location /Starprime #SSLRequireSSL Require all granted ProxyPass http://192.168.90.101:8000/Starprime ProxyPassReverse http://192.168.90.101:8000/ ProxyHTMLURLMap http://192.168.90.101/Starprime/ /Starprime /Location /VirtualHost VirtualHost *:443 SSLEngine On SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateKeyFile /etc/apache2/ssl/server.key Location / Require all granted ProxyPass http://192.168.90.101:8000/ ProxyPassReverse http://192.168.90.101:8000/ /Location LogFormat %h %l %u %t %r %s %b common CustomLog /var/log/apache2/raffael-access.log common /VirtualHost # vim: syntax=apache ts=4 sw=4 sts=4 sr noet Wrong URL: https://raffael.myserver.ch/Starprime/static/images/favicon.ico https://raffael.myserver.ch/Starprime/static/images/favicon.png https://raffael.myvogel.ch/Starprime/static/images/glyphicons-halflings.png *http://192.168.90.101:8000/Starprime/default/index/12/test.png -- this is my internal IP from the web2py service* https://raffael.myserver.ch/Starprime/static/images/twitter.png https://raffael.myserver/Starprime/static/images/facebook.png https://raffael.myserver.ch/Starprime/static/images/gplus-32.png The URL test.png is the problem. Not possible to reach from outside with this IP and no https. If I use the Wiki locally, *Edit Page adjust the *Media link with each Submit. I tried with different URL's locally. For example, I changed from 127.0.0.1 to localhost. After Submit from the Edit Page the Media URL was adjusted from 127.0.0.1 to localhost. But this is not working if I use web2py behind reverse proxy. Any idea to help? 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] auth_membership-table not updated upon login.
Hi Guys, I've just stumbled upon something of what i think could be a bug. When you use an openldap server(uid/cn) to manage the users and groups, these values should be imported to the respective auth-tables upon login (membership, user, etc..) However i've just added a new memberUid-attribute from a known user to a known group, but somehow this membership is not updated in the auth_membership-table. Am I missing something that could block this procedure? With kind regards, Jacobs Dennis. -- 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] Including a label inside a form field
I have a series of form elements as follows form = SQLFORM.factory ( Field ('client', requires=IS_IN_SET (['Client','Rhubarb','Custard','Bogies']), default='Client'), Field ('portfolio', requires=IS_IN_SET (['US Equity','Multi Asset ETF','Portfolio']), default='Portfolio'), Field ('benchmark', requires=IS_IN_SET (['SP 500','Custom Policy','Benchmark']), default='Benchmark'), Field ('methodology', requires=IS_IN_SET (['Brinson-Fachler', 'Regression','Method']), default='Method'), Field('level1', requires=IS_IN_SET(['Sector','Industry','Asset Class', 'Level 1']), default='Level 1'), Field('level2', requires=IS_IN_SET(['Sector','Industry','Asset Class', 'Level 2']), default='Level 2'), Field ('start_date', 'date', default=Start Date), Field ('end_date', 'date', default=End Date) ).process () I have a slightly fumble fingered approach to set a label inside each form field instead of as a label above or alongside as shown in the code, by setting the label as a default. The page this input form will be used for is a busy one and space is at a premium. Is there a more elegant way to put form labels into the form field that won't fail on the dates inputs? As a side question, the approach above displays the default inside the widget for Method, Level 1 and Level 2, but not for client, portfolio and benchmark. Is there something wrong with my code that would cause 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] MongoDB and Web2py in Windows
Hi All, anyone have success using MongoDb in DAL? When I ran web2py, I don't see MongoDB listed. here is what I got when I ran web2py command web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(psycopg2 ), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyod bc), IMAP(imaplib) I installed Pymongo. I downloaded and installed MongoDB in my Windows 7 and 8 computer to test. Same result. 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] Running scheduler on OS X - problem with urllib.getproxies() and multiprocessing
Hi, I'm just wondering if anyone has experienced the same problem or not. Basically, I get a segmentation fault (scheduler process killed by signal 11) if I try to start more than one scheduler under OS X. The problem can be reproduced with the built-in welcome app by adding a models/scheduler.py: from gluon.scheduler import Scheduler SCHEDULER = Scheduler(db) and then start the scheduler like this: ./web2py -K welcome,welcome I'm running web2py R-2.9.11 with python 2.7.8 (also same result with apple's python 2.7.6) on OS X 10.10.1(also got the same result on Maverick). I've managed to track down the problem to the getproxies() call in urllib which leads me to this bug: http://bugs.python.org/issue9405 By following the suggestion in the bug report, I was able to work around this problem by this patch: diff --git a/gluon/widget.py b/gluon/widget.py index cf885ae..62a38ee 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -1051,6 +1051,11 @@ def start_schedulers(options): print 'starting single-scheduler for %s...' % app_ run(app_, True, True, None, False, code) return + +# Work around OS X problem: http://bugs.python.org/issue9405 +import urllib +urllib.getproxies() + for app in apps: app_, code = get_code_for_scheduler(app, options) if not app_: Just wanted to throw this out in case anyone meets the problem. Thanks Jack -- 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] Getting Log details
Hi to all, I have an web2py framework and it is very good, and i want to know about some details like how to get user logs details, errors details, user management details and administration management. Thanks Mohemed -- 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: SQLFORM.grid search with custom request.vars
bump, any news? This is really anoying not to be able to preserve vars as we can args Dana petak, 24. listopada 2014. 21:47:38 UTC+2, korisnik Alen Cerovic napisao je: I am on the same boat, any solutions? Dana subota, 18. listopada 2014. 20:57:46 UTC+2, korisnik Alfonso de la Guarda Reyes napisao je: Hi, Any change about this? or at lesat how to solve? El jueves, 8 de mayo de 2014 03:22:14 UTC-5, Paolo Valleri escribió: I opened an issue https://code.google.com/p/web2py/issues/detail?id=1931 On Wednesday, May 7, 2014 3:24:38 PM UTC+2, Anthony wrote: On Wednesday, May 7, 2014 4:00:33 AM UTC-4, Paolo Valleri wrote: The workaround of the hidden fields seems to be much more complex for this simple issue, isn't it? In this specific case, we make a search in my point of view the most appropriate action should be a POST since we submit data to be processed. A drawback of that change will be that with the post, a user is not able to bookmark the search result. In addition to not allowing bookmarking, POST will cause problems if the user does a refresh or hits the back button (i.e., the browser will ask if you want to re-submit the form data). Anyway, I think the hidden fields could be added with a few lines of code, so shouldn't be too complex. 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] set form value from a session object
Hello (and Happy Thanksgiving) I've walked through the tutorials about creating a simple model (db table) then using the controller and view to automatically generate forms with validation. They are GREAT! My problem is when I tried to modify the form. For example, I created a simple model that stores timecard related data. db.define_table( 'time_record', Field('firstName',requires=IS_NOT_EMPTY() ), Field('lastName',requires=IS_NOT_EMPTY() ), Field('userId',requires=IS_NOT_EMPTY() ), Field('clientCode', requires = IS_INT_IN_RANGE(10,20) ), Field('dateOfWork', type='date', requires = IS_DATE() ), Field('hours', requires = IS_FLOAT_IN_RANGE(0.1,16.0) ) ) Next, I build the controller: def create_time_record(): return dict(form=crud.update(db.time_record,request.args(0))) Next, I have the view: {{extend 'layout.html'}} {{ = form }} Instead of the user entering the data in the form, I want to set one of the form fields to be invisible (or disabled) and automatically get its values from the session object from the log in, for example, session.auth.user.first_name. I can easily display auth data (id, first_name, last_name) but I cannot set this data into the form. {{ = form }} is so simple and powerful, yet how to I access a specific form element, set its value, and not affect the overall form validation process. Thank You All! Terry -- 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: (de-)select values for the multiselect_widget from ScubismLabs.
This topic can be closed. Instead of using the sqlform.factory()-statement, you can just set db.table.field.widget = multiselect_widget. To activate the widget for this field. On Friday, November 21, 2014 10:29:29 AM UTC+1, Dennis Jacobs wrote: Hi Kenji, First of all I wanted to thank you for submitting and maintaining your web2py plugins. However I do have one small issue with the “multiselect_widget”, which could be due to the fact that I don’t know how to implement the plugin properly. The problem I’m currently facing is the fact that I don’t know how to preselect values. For instance, I’m trying to create a page where a user’s membership can be rectified. The administrator first have to select a username (based on a dropdown from), afterwards the 2 boxes(“member of” and “Not member of”) should display the memberships of that specific user. And this is the point where I’m stuck. All the groups seem to end up in the same box, and I can’t figure out how to make the selection of “members” and “nomembers”. And I just wanted to know that I’m not doing something wrong, and I’m not forgetting something. The line I currently have to create this widget is the following. form = SQLFORM.factory(Field(Members, type='list:reference(db.auth_group.role)', requires=IS_IN_SET(grouplist,multiple=True), widget =rhmultiselect_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] Re: web2py RESTful timeout
I'm using MySQL, but I've also used SQLite. Yes I've verified that the POST is timing out. I ran another test and the script ran for 2 days until the error showed up again. I reloaded the default/index webpage in my browser and now its working again. I'll try disabling sessions as Derek suggests. Thanks. On Monday, November 24, 2014 12:15:23 PM UTC-7, Leonel Câmara wrote: Are you sure it's the POSTs to web2py that are timing out and not the fetching of the stock quotes? -- 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 MongoDB in Windows
Hi All, I'm having issue with Web2Py and MonogoDB in Windows 7. When I ran the cmd web2py, I don't see MongoDB driver database as available. Howerver, I installed the Pymongo driver and installed MongoDB successfully in my pc. Here is what I see when I do web2py command: Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(psycopg2 ), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyod bc), IMAP(imaplib) Your help is appreciated. 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: Web2py MongoDB in Windows
are you using the binary or the source distribution ? On Friday, November 28, 2014 5:05:22 PM UTC+1, Oliver wrote: Hi All, I'm having issue with Web2Py and MonogoDB in Windows 7. When I ran the cmd web2py, I don't see MongoDB driver database as available. Howerver, I installed the Pymongo driver and installed MongoDB successfully in my pc. Here is what I see when I do web2py command: Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(psycopg2 ), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyod bc), IMAP(imaplib) Your help is appreciated. 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: Sticky sessions in a distributed environment
ticketing doesn't depend on admin, and you - again usually - don't want to see errors on the production server. Just copy errors over and see them on your development instance (or let the script tickets2email.py send the errors over to you). And...in a production server appadmin.py isn't needed. BUT you're right. Given that it kinda does work on GAE, it should kinda work on other diskless PaaS as well. It's just not received - yet - that much attention. -- 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's included connection pooling VS external pooling software
On Friday, November 28, 2014 3:31:02 PM UTC+1, Lisandro wrote: I go back to this thread because today I ran with the same problem: postgresql reaching max_connection limits and, therefor, some of my websites throwing intermitent HTTP 500 errors (because web2py couldn't connect to the database). To remind, we are talking of a VPS with multiple instances of web2py running, all of them serving the same web2py app, each one connecting to a different postgresql database (however the database structure is the same accross all the databases). Each web2py instance is served by a lighttpd virtual host through fastcgi. Each virtual host (that is, each web2py instance) receives a different volume of traffic (that is obvious, they are different websites with different public). The original problem (the one that caused I post this question in the first place) was that the postgresql database server was reaching the max_connections limit and, in consecuence, some of the websites were throwing intermitent HTTP 500 errors (web2py couldn't connect to database). Then, the user oriented me with pool_size parameter of DAL constructor. Thanks again! I've been reading the web2py documentation about pooling [1] and I notice that it says that When the next http request arrives, web2py tries to recycle a connection from the pool and use that for the new transaction. If there are no available connections in the pool, a new connection is established. So, if I didn't get it wrong, I deduce that with web2py's pooling mechanism I can't overcome the max_connections postgresql limit. That is because, no matter the size of the pool, if the pool is full and the website is receiving a lot of requests, new connetions will be created, and eventually the database server will reach the max_conectios limit. no, you got it wrong again. pool_size=5 will create AT MOST 5 connections . if a 6th is needed, users will wait for a connection to be freed. if your postgresql accept at most 50 connections, do the math. Every db = DAL(, pool_size=5) lying around will create AT MOST 5 connections, and that means you can host 10 apps. If you need 50 apps, set pool_size=1 and let users wait, or set max_connections in postgres to a higher value. -- 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: add task and wait the result
def test(): newid = sched.queue_task(, immediate=True) db.commit() #the db instance where the scheduler is while True: rtn = sched.task_status(newid) if rtn.status == 'COMPLETED': ...blablabla break time.sleep(3) not tested (haven't a web2py to try it on ATM) but you get the idea On Friday, November 28, 2014 7:30:18 AM UTC+1, Manuele wrote: Hi, I would like to add an immediate task to the scheduler and wait for the result within the same submit. Is it possible? How? Thank you very mutch 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: Running scheduler on OS X - problem with urllib.getproxies() and multiprocessing
whoa! yet another reason to ditch urllib in favour of requests. thanks for the report though. On Tuesday, November 25, 2014 8:40:38 PM UTC+1, Jack Kuan wrote: Hi, I'm just wondering if anyone has experienced the same problem or not. Basically, I get a segmentation fault (scheduler process killed by signal 11) if I try to start more than one scheduler under OS X. The problem can be reproduced with the built-in welcome app by adding a models/scheduler.py: from gluon.scheduler import Scheduler SCHEDULER = Scheduler(db) and then start the scheduler like this: ./web2py -K welcome,welcome I'm running web2py R-2.9.11 with python 2.7.8 (also same result with apple's python 2.7.6) on OS X 10.10.1(also got the same result on Maverick). I've managed to track down the problem to the getproxies() call in urllib which leads me to this bug: http://bugs.python.org/issue9405 By following the suggestion in the bug report, I was able to work around this problem by this patch: diff --git a/gluon/widget.py b/gluon/widget.py index cf885ae..62a38ee 100644 --- a/gluon/widget.py +++ b/gluon/widget.py @@ -1051,6 +1051,11 @@ def start_schedulers(options): print 'starting single-scheduler for %s...' % app_ run(app_, True, True, None, False, code) return + +# Work around OS X problem: http://bugs.python.org/issue9405 +import urllib +urllib.getproxies() + for app in apps: app_, code = get_code_for_scheduler(app, options) if not app_: Just wanted to throw this out in case anyone meets the problem. Thanks Jack -- 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: add task and wait the result
Related, but not exactly the same question: I'm submitting an immediate task in a regular (no sleep or anything -- though no special commit either); I can see it's queued for seconds and sometimes minutes before getting assigned and running. There are no other tasks waiting or running, there are one or two schedulers running (one starts with app server, one independently - but I tried only one with same results). Before I dig deep into debugging the scehduler - is there something simple I might be missing? Other things: main app db, auth db and sched db are all different, and all are SQLite files. Running on Linux. Tasks are given a uuid by me (easiest way to track if something was done in a previous run or not - uuid reflects the exact operation needed). Thanks in advance. On Friday, November 28, 2014 7:30:44 PM UTC+2, Niphlod wrote: def test(): newid = sched.queue_task(, immediate=True) db.commit() #the db instance where the scheduler is while True: rtn = sched.task_status(newid) if rtn.status == 'COMPLETED': ...blablabla break time.sleep(3) not tested (haven't a web2py to try it on ATM) but you get the idea On Friday, November 28, 2014 7:30:18 AM UTC+1, Manuele wrote: Hi, I would like to add an immediate task to the scheduler and wait for the result within the same submit. Is it possible? How? Thank you very mutch 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: Getting a form field to return var on select
You'll need to use Ajax. Check out this link: http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910. Anthony On Thursday, November 27, 2014 7:04:28 PM UTC-5, tahnoon pasha wrote: Hi, I saw a discussion begin on this subject on Stackoverflow but can't find the continuation here. I have a case where I need to use the input in one form field (eg portfolio) to filter options of the IS_IN_SET constraint for a subsequent form field (eg sector/industry). I'm pretty new to web2py and jquery. How would I go about implementing this? 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: UPDATED AGENDA! Bay Area web2py meetup (refreshments) -- 12/5/2014, 6:30PM - 9:00PM -- BE THERE!!!
I will attend. -Dave Lypka. On Thursday, November 6, 2014 1:48:14 AM UTC-6, weheh wrote: *Massimo Di Pietro, web2py's originator, will attend our own Bay Area* *web2py meetup* to meet, greet and present. Additional talks by Dexter Hadley, of Stanford University and Richard Gordon, of YAKiToMe! will be given. Details follow: Date: *Friday, December 5* Time: *6:30PM to 9:00PM* Location: *1125 Jackson Street, Albany, CA (directly off the Buchanan freeway ramp)* Sponsor: *YAKiToMe.com* (a development-stage web2py-based TTS app) Cost: *Free* RSVP: *please RSVP by replying inline to this post* Parking: Plentiful free parking is readily available directly in front of the meeting room *Agenda: * - 6:30PM to 7:00PM Informal mixer with pizza - 7:00PM to 8:00PM Massimo Di Pierro, Assoc. Prof. High Performance and Scientific Computing, School of Computing, De Paul University, creator of web2py - 8:00PM to 8:30PM Dexter Hadley, Md/PhD, Stanford University Division of Systems Medicine Department of Pediatrics on using web2py to crowd source disease signatures from open functional genomics data - 8:30PM to 9:00PM Richard Gordon, MSEE Stanford University, YAKiToMe.com, on Extreme Off-roading With Web2py -- Lessons Learned Each talk will have some time for QA *Equipment Needs: *We still need a quality digital projector that can plug into a laptop. If you are coming and can lend a working projector for the night, please let me know as it would be much appreciated. Otherwise, I will rent one. If you are giving a presentation, please plan on bringing your own laptop. I will have a Windows laptop available just in case. *Spread The Word*. If you belong to the python user's group in San Francisco or elsewhere in the Bay Area or are a member of a Django, Drupal, Ruby or other web framework user's group, please help spread the word about this meetup. This posting will be the official organizing document for the meetup, so post your questions and comments here. Thanks, and hope to meet a bunch of web2py'ers on December 5! -- 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 form value from a session object
To make a field un-writable, set its writable attribute to False. To completely remove it from the form altogether, you can also set its readable attribute to False. If you would like the field to get a default value based on data in the session, you can set the default and/or update attributes of the field based on the session values. Anthony On Wednesday, November 26, 2014 2:02:59 PM UTC-5, Terry Toy wrote: Hello (and Happy Thanksgiving) I've walked through the tutorials about creating a simple model (db table) then using the controller and view to automatically generate forms with validation. They are GREAT! My problem is when I tried to modify the form. For example, I created a simple model that stores timecard related data. db.define_table( 'time_record', Field('firstName',requires=IS_NOT_EMPTY() ), Field('lastName',requires=IS_NOT_EMPTY() ), Field('userId',requires=IS_NOT_EMPTY() ), Field('clientCode', requires = IS_INT_IN_RANGE(10,20) ), Field('dateOfWork', type='date', requires = IS_DATE() ), Field('hours', requires = IS_FLOAT_IN_RANGE(0.1,16.0) ) ) Next, I build the controller: def create_time_record(): return dict(form=crud.update(db.time_record,request.args(0))) Next, I have the view: {{extend 'layout.html'}} {{ = form }} Instead of the user entering the data in the form, I want to set one of the form fields to be invisible (or disabled) and automatically get its values from the session object from the log in, for example, session.auth.user.first_name. I can easily display auth data (id, first_name, last_name) but I cannot set this data into the form. {{ = form }} is so simple and powerful, yet how to I access a specific form element, set its value, and not affect the overall form validation process. Thank You All! Terry -- 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] Pagination within a SQLFORM.factory
I want to let the user do a query and paginate through the resulting table. grid/smartgrid would be great, except that I need to supply the query through a form and not leave it open -- the query has minimum and maximum values for most fields, multiple selects for others (I build the search query form itself with SQLFORM.factory, though it can be done any other way). Is there a simple way to do this using grid? If not, is there a simple way to do this within SQLform, like add first page, last page, next page and prev page buttons that would resubmit the form with a hidden field of page that changes between calls? I would much prefer grid (or similar), so that I would also get result sorting for free, etc. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Web2py's included connection pooling VS external pooling software
Mmm... I see. That was my understanding in the first place. At that time I did the maths, I had 10 apps, each one using a pool_size of 3. In postgresql.conf max_connections was set to 80. However this morning, with those numbers, almost every of my websites was throwing intermitent HTTP 500 errors, and the error tickets were all the same: FATAL: remaining connection slots are reserved for non-replication superuser connections. Right now, I have almost 13 websites, all of them with pool_size in 3, and max_connections in 80. However, if I check the table pg_stat_activity I can see 65 connections, and I can see there is 5 connections per app. I've tried even setting pool_size to 1 for one of the apps, restarted database server and webserver, but again I check pg_stat_activity and I see 5 connections for that app. ¿Am I missing something too ovbious? 2014-11-28 14:25 GMT-03:00 Niphlod niph...@gmail.com: On Friday, November 28, 2014 3:31:02 PM UTC+1, Lisandro wrote: I go back to this thread because today I ran with the same problem: postgresql reaching max_connection limits and, therefor, some of my websites throwing intermitent HTTP 500 errors (because web2py couldn't connect to the database). To remind, we are talking of a VPS with multiple instances of web2py running, all of them serving the same web2py app, each one connecting to a different postgresql database (however the database structure is the same accross all the databases). Each web2py instance is served by a lighttpd virtual host through fastcgi. Each virtual host (that is, each web2py instance) receives a different volume of traffic (that is obvious, they are different websites with different public). The original problem (the one that caused I post this question in the first place) was that the postgresql database server was reaching the max_connections limit and, in consecuence, some of the websites were throwing intermitent HTTP 500 errors (web2py couldn't connect to database). Then, the user oriented me with pool_size parameter of DAL constructor. Thanks again! I've been reading the web2py documentation about pooling [1] and I notice that it says that When the next http request arrives, web2py tries to recycle a connection from the pool and use that for the new transaction. If there are no available connections in the pool, a new connection is established. So, if I didn't get it wrong, I deduce that with web2py's pooling mechanism I can't overcome the max_connections postgresql limit. That is because, no matter the size of the pool, if the pool is full and the website is receiving a lot of requests, new connetions will be created, and eventually the database server will reach the max_conectios limit. no, you got it wrong again. pool_size=5 will create AT MOST 5 connections . if a 6th is needed, users will wait for a connection to be freed. if your postgresql accept at most 50 connections, do the math. Every db = DAL(, pool_size=5) lying around will create AT MOST 5 connections, and that means you can host 10 apps. If you need 50 apps, set pool_size=1 and let users wait, or set max_connections in postgres to a higher value. -- 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/5RTO_RqCsus/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: Domain model and web2py DAL
I suppose it depends on your requirements, though note that the web2py DAL isn't *that *simple -- you might find you can get pretty far with things like virtual fields http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Virtual-fields, table inheritance http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance, and table methods https://groups.google.com/forum/#!msg/web2py/ceqq4JwkWi4/csn0kZfyPuwJ. Anthony On Wednesday, November 26, 2014 4:17:26 PM UTC-5, Alan Evangelista wrote: Hi. I'd like to use the domain model pattern and keep database access code outside models. It seems to me that using a simple database abstraction layer such as web2py DAL better fits to transaction script (no domain models or anemic domain model - models reflect tables) or active records (models have data, logic and data access) design patterns. It seems to me that using a full domain model fits better with the data mapper pattern and probably I should use an ORM. You agree? How you usually embed web2py HAL into your application (from an architecture perspective)? -- 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: Pagination within a SQLFORM.factory
The grid allows you to implement a custom search widget (via the search_widget argument) as well as a custom server-side search function (via the searchable argument) to build a query based on the keywords returned by the widget. This isn't well documented, so you'll have to look at the source code to figure out what the widget and searchable function should look like. Anthony On Friday, November 28, 2014 2:45:07 PM UTC-5, nick name wrote: I want to let the user do a query and paginate through the resulting table. grid/smartgrid would be great, except that I need to supply the query through a form and not leave it open -- the query has minimum and maximum values for most fields, multiple selects for others (I build the search query form itself with SQLFORM.factory, though it can be done any other way). Is there a simple way to do this using grid? If not, is there a simple way to do this within SQLform, like add first page, last page, next page and prev page buttons that would resubmit the form with a hidden field of page that changes between calls? I would much prefer grid (or similar), so that I would also get result sorting for free, etc. -- 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: Sticky sessions in a distributed environment
Louis, I think you're getting a little pushback because you make a rather extreme criticism in the face of a fairly small issue that (a) you can easily work around right now and (b) would not be difficult to fix in the framework. Furthermore, the issue at hand affects features of web2py (i.e., admin and appadmin) that most other frameworks don't even have. Note, aside from adding a few lines in the admin app to have its sessions stored in the db, another option might be to edit the handler file used to start web2py. In that file, you should be able to do something like this: from gluon.settings import global_settings global_settings.db_sessions = True Your handler file shouldn't change on web2py upgrade, so this setting will remain in effect. If all you really need is appadmin, then you could also directly edit the appadmin.py controller so it uses the Auth of its own app rather than the admin app (this won't change when you upgrade web2py because the appadmin.py file is part of the app code and is not automatically overwritten on upgrade). In fact, this is already how the appadmin manage feature works, so if that feature is adequate for you, you don't need to make any changes at all. As for error tickets, if you want them to go directly into the db instead of initially being written to the filesystem, I think you can add the following in a model: request.tickets_db = db To then view the tickets via admin, you need a ticket_storage.txt file in the app's /private folder that includes the URI if the database. I suppose this poses a problem on Heroku, so we may need to come up with an alternative means of getting the URI. More generally, perhaps we could add a feature that would allow a flag to be set indicating that the runtime environment lacks a persistent filesystem, in which case, sessions and error tickets would automatically go in the database. The framework obviously already includes the needed functionality, as this is what is done on GAE -- we just need to generalize the setting so it can be used on any platform. The thing is : my disappointment here lies in the architecture, not the features. There is little contribution to be done when regarding an architectural issue (except a big refactoring of course, which you can't expect a regular contributor to do on his own). I don't think this is an architectural issue or requires a big refactoring. We already have the functionality in place to work on GAE -- it just needs to be tweaked to apply more generally. I think it is fair to share personal experiences regarding the framework (good or bad), as long as they are relevant. Of course, but consider the tone. Every improvement to web2py is contributed by a volunteer. Same goes for appadmin.py and its permission-based manage feature which is described as a role-based database access. Why would you define roles in a local environment ? Obviously this is meant to go on production in a secure back-office... As noted above, the manage feature of appadmin does not in fact delegate authorization to the admin app. It instead relies directly on the app's own Auth system (which is how it is able to use role-based authorization). In any case, I agree that to the degree that it is feasible, it should be possible to run admin and appadmin in production. They are probably not the ideal tools in serious production environments, but they have their place as a convenience in some settings. We should be realistic, though -- if you don't have a persistent filesystem, the admin app will have its limitations. 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.
Re: [web2py] Re: Domain model and web2py DAL
You could see DAL as a scoped ORM i.e. for specific kind of objects, these object are Table(s) containing Field(s) and the way to manipulate those objects mimics as much as possible the relational model. By no mean DAL is thin. As a matter of fact it allows extremely sophisticated thing like accessing an IMAP server with relational semantics. The connection code is one liner and you can put it anywhere you please, there is hardly the need to write any SQL by hand. Indeed I often use the DAL as a reference to generate SQL that I need to use in places where I can't use the DAL itself... 2014-11-28 20:51 GMT+01:00 Anthony abasta...@gmail.com: I suppose it depends on your requirements, though note that the web2py DAL isn't *that *simple -- you might find you can get pretty far with things like virtual fields http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Virtual-fields, table inheritance http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Table-inheritance, and table methods https://groups.google.com/forum/#!msg/web2py/ceqq4JwkWi4/csn0kZfyPuwJ. Anthony On Wednesday, November 26, 2014 4:17:26 PM UTC-5, Alan Evangelista wrote: Hi. I'd like to use the domain model pattern and keep database access code outside models. It seems to me that using a simple database abstraction layer such as web2py DAL better fits to transaction script (no domain models or anemic domain model - models reflect tables) or active records (models have data, logic and data access) design patterns. It seems to me that using a full domain model fits better with the data mapper pattern and probably I should use an ORM. You agree? How you usually embed web2py HAL into your application (from an architecture perspective)? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: MongoDB and Web2py in Windows
Are you using the source version of the binary version of web2py? The binary version comes his own python version. On Wednesday, 26 November 2014 09:42:56 UTC-6, Oliver wrote: Hi All, anyone have success using MongoDb in DAL? When I ran web2py, I don't see MongoDB listed. here is what I got when I ran web2py command web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2014 Version 2.9.11-stable+timestamp.2014.09.15.23.35.11 Database drivers available: SQLite(sqlite3), MySQL(pymysql), PostgreSQL(psycopg2 ), PostgreSQL(pg8000), MSSQL(pyodbc), DB2(pyodbc), Teradata(pyodbc), Ingres(pyod bc), IMAP(imaplib) I installed Pymongo. I downloaded and installed MongoDB in my Windows 7 and 8 computer to test. Same result. 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: auth_membership-table not updated upon login.
Only the users table is populate in this case, not groups and membership. On Thursday, 27 November 2014 07:20:27 UTC-6, Dennis Jacobs wrote: Hi Guys, I've just stumbled upon something of what i think could be a bug. When you use an openldap server(uid/cn) to manage the users and groups, these values should be imported to the respective auth-tables upon login (membership, user, etc..) However i've just added a new memberUid-attribute from a known user to a known group, but somehow this membership is not updated in the auth_membership-table. Am I missing something that could block this procedure? With kind regards, Jacobs Dennis. -- 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: Including a label inside a form field
say you have a field called 'client' you can do: form.element(_name='client')['_placeholder'] = 'The label for client' Massimo On Thursday, 27 November 2014 20:02:36 UTC-6, tahnoon pasha wrote: I have a series of form elements as follows form = SQLFORM.factory ( Field ('client', requires=IS_IN_SET (['Client','Rhubarb','Custard','Bogies']), default='Client'), Field ('portfolio', requires=IS_IN_SET (['US Equity','Multi Asset ETF','Portfolio']), default='Portfolio'), Field ('benchmark', requires=IS_IN_SET (['SP 500','Custom Policy','Benchmark']), default='Benchmark'), Field ('methodology', requires=IS_IN_SET (['Brinson-Fachler', 'Regression','Method']), default='Method'), Field('level1', requires=IS_IN_SET(['Sector','Industry','Asset Class', 'Level 1']), default='Level 1'), Field('level2', requires=IS_IN_SET(['Sector','Industry','Asset Class', 'Level 2']), default='Level 2'), Field ('start_date', 'date', default=Start Date), Field ('end_date', 'date', default=End Date) ).process () I have a slightly fumble fingered approach to set a label inside each form field instead of as a label above or alongside as shown in the code, by setting the label as a default. The page this input form will be used for is a busy one and space is at a premium. Is there a more elegant way to put form labels into the form field that won't fail on the dates inputs? As a side question, the approach above displays the default inside the widget for Method, Level 1 and Level 2, but not for client, portfolio and benchmark. Is there something wrong with my code that would cause 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] Re: Getting a form field to return var on select
for example def index(): return dict(form = SQLFORM(Field('a',requires=IS_IN_SET(('one','two'))),Field('b',required=IS_IN_SET([] def options(): cases = {'one':['x','y','z'], 'two':['w','e','r']} return response.json(cases[request.vars.a]) and in JS jQuery('[name=a]').change(function(){jQuery.getJSON('options',function(data){jQuery('[name=b]').html(''.join(data.map(function(item){return 'option'+item+'/item';}));})}); if I balanced the brackets right. ;-) On Thursday, 27 November 2014 18:04:28 UTC-6, tahnoon pasha wrote: Hi, I saw a discussion begin on this subject on Stackoverflow but can't find the continuation here. I have a case where I need to use the input in one form field (eg portfolio) to filter options of the IS_IN_SET constraint for a subsequent form field (eg sector/industry). I'm pretty new to web2py and jquery. How would I go about implementing this? 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 with bootstrap-slider bootstrap-typeahead
Hy everyone. I'm working with web2py since one year. In most cases it's a fine and easy way to develop a nice working web app. Now i want to create a new web application in web 2.0 design. For this i want to use more bootstrap components i need to use the bootstrap slider http://seiyria.github.io/bootstrap-slider/ and the autocomplete extension https://twitter.github.io/typeahead.js/examples/ i've downloaded the java scripts and css files and placed them to the js and css directory. After this, i added link href={{=URL('static', 'css/bootstrap-slider.css')}} rel=stylesheet type=text/css / script src={{=URL('static','js/bootstrap-slider.js')}}/script in my view html file. i also added a sample in my view file.. input id=ex1 data-slider-id='ex1Slider' type=text data-slider-min=0 data-slider-max=20 data-slider-step=1 data-slider-value=14/ script $('#ex1').slider({ formatter: function(value) { return 'Current value: ' + value; } }); /script style #ex1Slider .slider-selection { background: #BABABA; } /style But it does not work. Just a empty input filed is displayed.. I added a alter in the slider.js file. This works - alter call is displayed. Can anybody help me?? Regards Florian -- 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 select column sort order
Hi I am using a query like ; rows = db(db.v_histo_freins.busid == busid).select() and I am using a function to generate the HTML table. I made this function to serve my look and feel needs and so it would adapt to any kind of rows result. When I run the query and my the function, I get the columns ordered by... i do not know what process. I have even tried et force the column order with ; def affiche_tableau_freins(busid): rows = db(db.v_histo_freins.busid == busid).select( db.v_histo_freins.busid, db.v_histo_freins.DateJour, db.v_histo_freins.FRAVG, db.v_histo_freins.FRAVD, db.v_histo_freins.FRARG, db.v_histo_freins.FRARD ) But somehow the columns appears to have a mind of their own. Is there a simple way to force the column order in the rows result of the query Thank's -- 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: Dal select column sort order
select(orderby=db.v_histo_freins.DateJour||db.v_histo_freins.FRAVD) On Friday, 28 November 2014 12:32:28 UTC-6, Daniel Lafrance wrote: Hi I am using a query like ; rows = db(db.v_histo_freins.busid == busid).select() and I am using a function to generate the HTML table. I made this function to serve my look and feel needs and so it would adapt to any kind of rows result. When I run the query and my the function, I get the columns ordered by... i do not know what process. I have even tried et force the column order with ; def affiche_tableau_freins(busid): rows = db(db.v_histo_freins.busid == busid).select( db.v_histo_freins.busid, db.v_histo_freins.DateJour, db.v_histo_freins.FRAVG, db.v_histo_freins.FRAVD, db.v_histo_freins.FRARG, db.v_histo_freins.FRARD ) But somehow the columns appears to have a mind of their own. Is there a simple way to force the column order in the rows result of the query Thank's -- 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.