[web2py] Resurrecting PyCon-Tech with web2conf

2012-04-07 Thread Mariano Reingart
Hello Just in case this is useful to others, I have added support to import old PyCon-Tech (django 0.96) models into web2conf (web2py), including: - "wiki" pages (django_flatpage) - menu (navbar_navbarentry) - attendees (auth_user, usermgr_userprofile, gmaps_gaddress) - activities (propmgr_pr

[web2py] Re: Rocket errors on importing python library

2012-04-07 Thread Unyo
Try editing the readability logger to specify a logger name instead of just the root: https://github.com/buriy/python-readability/blob/master/readability/htmls.py -logging.getLogger().setLevel(logging.DEBUG) +logging.getLogger('readability').setLevel(logging.DEBUG) On Tuesday, March 27, 2

[web2py] Re: Rocket errors on importing python library

2012-04-07 Thread Unyo
Also, how in the world did you enable debugging? I want to see if the minthreads and maxthreads settings passed via command string actually work. On Saturday, April 7, 2012 8:08:51 PM UTC-10, Unyo wrote: > > rocket breaks sometimes if you have limited memory, try entering "ulimit > -s 1024" into

[web2py] Re: Rocket errors on importing python library

2012-04-07 Thread Unyo
rocket breaks sometimes if you have limited memory, try entering "ulimit -s 1024" into the shell before executing web2py. Not sure why it works, but it does.

[web2py] Re: Rocket errors on importing python library

2012-04-07 Thread Unyo
rocket breaks sometimes if you have limited memory, try entering "ulimit -s 1024" into the shell before executing web2py. Not sure why it works, but it does. On Tuesday, March 27, 2012 3:33:58 AM UTC-10, Rohan wrote: > > any updates? > > On Monday, 26 March 2012 20:03:07 UTC+5:30, Rohan wrote: >

Re: [web2py] no more cherrypy wsgiserver

2012-04-07 Thread Unyo
When web2py switched from cherrypy to rocket, now I can't seem to start it on any resource-constrained VPNs (currently running w/ 96MB RAM). To me, this is a really big downer since I love web2py's ability to create prototype applications using nothing but a shell and a browser (using minimal r

[web2py] Re: represent in form

2012-04-07 Thread Annet
Hi Anthony, Are you talking about a read-only form or an update form? On an update > form, it cannot use the alternative representation because the user must > enter the actual field value, not merely a transformed representation of it > (web2py has no general way of converting back from repres

[web2py] Re: syncing plugins across apps and with github -- again

2012-04-07 Thread kenji4569
I met the same issue, and took the following approach: - Create a centralized plugin app For me, this is the following app: https://github.com/sqlabs/sqlabs/tree/master/modules - Reference the modules of the app from other apps like: import applications.sqlabls.modules.plugin_color_widget In thi

[web2py] Re: Why isn't auth.settings.register_onaccept=[complete_login] passing execution to def complete_login()

2012-04-07 Thread weheh
Strange. I had some ajax calls in the registration section already, which I took out because they didn't seem to do anything. You know ... response.js='ajax...' I thought I had it working at some point, but then it stopped working. Hmm... looks like I have some debugging to do. ;-) On Sunday, A

[web2py] Re: new feature in trunk: full auditing

2012-04-07 Thread tomt
Hi, I tried using your new versioning feature in trunk. I created an app using a mysql database: db = DAL('mysql://version:version@localhost/version') When I used the admin function to define a new user I received the following error: (1452, u'Cannot add

[web2py] Re: Why isn't auth.settings.register_onaccept=[complete_login] passing execution to def complete_login()

2012-04-07 Thread Anthony
auth.settings.register_onaccept is a callback executed from the auth.register() function. But you have created your own register() function, which does not call auth.register(), hence the callback is never called. Since you have an entirely custom registration function, you'll have to call comp

[web2py] Re: Stopping a timer from an Ajax call (Clienttools)

2012-04-07 Thread weheh
I'm not entirely clear what your callback function or page.ready function does, but this is how I do it. I have an ajax callback function that returns a script that clears the timer. def clear_timer(timer_id): """pseudo-code""" return """ if (...check timer_id valid ...) cle

[web2py] Why isn't auth.settings.register_onaccept=[complete_login] passing execution to def complete_login()

2012-04-07 Thread weheh
In the typical 0_db.py file I'm setting auth.settings.register_onaccept=[complete_login] I also define complete_login there and it raises an HTTP(200) for a redirect. Now, in my "user" controller I have: def register(): ... register_form = SQLFORM.factory( db.auth_user, ... )

[web2py] Madeira Cloud

2012-04-07 Thread Massimo Di Pierro
http://www.madeiracloud.com/

Re: [web2py] Re: w2b2py book command-line examples

2012-04-07 Thread Massimo Di Pierro
In my view the -N should always be there unless the purpose of running the script is that of starting a cron process. -N should have worked in reverse. On Saturday, 7 April 2012 16:30:16 UTC-5, Jonathan Lundell wrote: > > On Apr 7, 2012, at 2:03 PM, Cédric Mayer wrote: > > Personnaly, I created a

Re: [web2py] Re: w2b2py book command-line examples

2012-04-07 Thread Jonathan Lundell
On Apr 7, 2012, at 2:03 PM, Cédric Mayer wrote: > Personnaly, I created a shortcut (in Windows) in order to test the model of > my application: > \web2py.exe -M -S Shortcuts are good, and perhaps there ought to be a script in the web2py root. Is -N desirable, btw? I suppose it depends on what

[web2py] Re: w2b2py book command-line examples

2012-04-07 Thread Cédric Mayer
Personnaly, I created a shortcut (in Windows) in order to test the model of my application: \web2py.exe -M -S Le samedi 7 avril 2012 19:04:09 UTC+2, Jonathan Lundell a écrit : > > In Chapter 6 (DAL), there are a lot of command-line examples (with >>> > prompts) (side note: a lot of them aren't

Re: [web2py] new feature in trunk: full auditing

2012-04-07 Thread simon
Very useful. Brilliant thanks. Minor error - line 6951 in DAL is missing an s. Should be archive_name = '%(tablename)s_archive' On Friday, 6 April 2012 05:35:38 UTC+1, Massimo Di Pierro wrote: > > It stores all previous versions. > > On Thursday, 5 April 2012 22:29:46 UTC-5, mart wrote: >> >> M

[web2py] Stopping a timer from an Ajax call (Clienttools)

2012-04-07 Thread Keith Edmunds
I'm using clienttools.py to put a timer on a page; the timer calls a controller function (imaginatively called 'tick') every second, which in turn updates a div on the page via Ajax. So far, so good. I want the 'tick' controller function to be able to stop/disable the timer under certain circumsta

[web2py] syncing plugins across apps and with github -- again

2012-04-07 Thread monotasker
I want to float a proposal for plugin infrastructure that I'd love to see made part of the web2py core. It takes a bit of explanation, so bear with the long post. I'm starting to find that the syncing issue is a major one with the (otherwise great) plugin infrastructure. I have a growing series

[web2py] w2b2py book command-line examples

2012-04-07 Thread Jonathan Lundell
In Chapter 6 (DAL), there are a lot of command-line examples (with >>> prompts) (side note: a lot of them aren't properly formatted). It'd be helpful to readers if at least once (say at the top of the chapter) the python command used to get to the prompt were shown. Presumably it involves -S, -M

Re: [web2py] Re: Hiding columns in SQLFORM.grid

2012-04-07 Thread Keith Edmunds
On Sat, 7 Apr 2012 07:41:16 -0700 (PDT), abasta...@gmail.com said: > Before constructing the grid, try db.mytable.myfield.readable = False. Anthony, very neat, and it works: thank you. -- "You can have everything in life you want if you help enough other people get what they want" - Zig Ziglar.

[web2py] Re: connection problem to mysql with source installation: 'NoneType' object has no attribute 'connect'

2012-04-07 Thread Anthony
Looks like the DAL is using the pymysql driver, which is included in /gluon/contrib. If you've pulled the DAL out of /gluon and don't have pymysql, then it won't find the driver. Anthony On Saturday, April 7, 2012 11:26:25 AM UTC-4, mert.nuhoglu wrote: > > I installed web2py as source and wante

Re: [web2py] Re: Scaling web2py

2012-04-07 Thread Bruce Wade
Well I know the major bottle neck in the site is the binary tree. I am still trying to figure out how to do this the best and most efficient. If this was a stand alone app in c/c++ this would all be in memory which wouldn't be such a problem. However how this is implemented it needs to query throug

[web2py] Re: auth_user reference to other table

2012-04-07 Thread Anthony
> > Define it as Field('country', 'reference country') instead of >> Field('country', db.country) -- the latter won't work if db.country hasn't >> been defined yet. >> > > Should I use 'reference table' instead of db.table in all table > definitions or just in the definition of tables that refe

[web2py] Re: represent in form

2012-04-07 Thread Anthony
> > I am talking about the second bullet in > http://web2py.com/books/default/chapter/29/6#Record-representation. > >- To set the db.othertable.person.represent attribute for all fields >referencing this table. This means that SQLTABLE will not show references >by id but will use th

[web2py] connection problem to mysql with source installation: 'NoneType' object has no attribute 'connect'

2012-04-07 Thread mert.nuhoglu
I installed web2py as source and wanted to use DAL without the rest of the framework. But DAL does not connect to mysql: >>> DAL('mysql://user1:user1@localhost/test_rma') ... RuntimeError: Failure to connect, tried 5 times: 'NoneType' object has no attribute 'connect' Whereas MySQLdb can con

[web2py] Re: Unit testing and faking authentication

2012-04-07 Thread Anthony
For @auth.requires_login() to pass, I think you just need auth.user to exist (and not be None). If your layout includes auth.navbar(), I think the auth.user object at least needs to include an "id" attribute as well (i.e., auth.user.id should be some integer). So maybe add something like this in

Re: [web2py] Re: How to reuse the db definition?

2012-04-07 Thread Ronghui Yu
Actually I have only one app. What I am going to do is to import the initial data into database from some text format files. I need to write a Python script to read from the source file, and do some operations on the data, then insert into database. I could do that via pure SQL, but I like the way

[web2py] Re: Scaling web2py

2012-04-07 Thread Massimo Di Pierro
Rightwhat? [changing color to red] Note to self. Never do math before fully waking up. Correction: 2 reqs/second/server. (1M/24/60/60/6 servers). Still ok from web2py prospective. If all requests hit the database once: 12 reqs/second. It really depends of what those requests do. Massimo

[web2py] Re: How to reuse the db definition?

2012-04-07 Thread Massimo Di Pierro
I would like to stress once more a design issue. If two apps share the same table/model there are two cases: a) the apps are independent (it is possible to distribute them independently) b) the apps are dependent (they must be distributed together) In case a) the model cannot be shared. Each ap

Re: [web2py] Re: Won't DB detect table existence?

2012-04-07 Thread Ronghui Yu
No, I did NOT change anything. Just before I restarted Apache, I used the same URI string in Python command line to connect the DB. But I found that I could connect to it, but the return DB instance does not have the table definition. On Sat, Apr 7, 2012 at 10:22 PM, Massimo Di Pierro < massimo.di

[web2py] Re: Hiding columns in SQLFORM.grid

2012-04-07 Thread Anthony
Before constructing the grid, try db.mytable.myfield.readable = False. Anthony On Saturday, April 7, 2012 6:16:39 AM UTC-4, backseat wrote: > > Is it possible to hide columns in a SQLFORM.grid? > > I need to retrieve some columns in the query to build some custom links, > but I don't want those c

Re: [web2py] Re: Scaling web2py

2012-04-07 Thread Bruce Wade
Thanks for the req/sec break down, we get most of our traffic in a 5-6 hour window period. A code review would be good I am sure there are a lot of areas that could use some improvements. -- Regards, Bruce On Sat, Apr 7, 2012 at 7:33 AM, Anthony wrote: > 1M reqs/day is 7 reqs/minute. >> > > No

[web2py] Re: How to reuse the db definition?

2012-04-07 Thread Anthony
Another option might be http://web2py.com/books/default/chapter/29/6#Using-DAL-without-define-tables. Note, in that case, the table definitions will include the field names and types, but not the non-database related web2py-specific attributes, such as validators, labels, widgets, default valu

[web2py] Re: Scaling web2py

2012-04-07 Thread Anthony
> > 1M reqs/day is 7 reqs/minute. > Now we know how Massimo gets so much done -- his days are 2400 hours long. ;-)

[web2py] Re: Scaling web2py

2012-04-07 Thread Massimo Di Pierro
Hello Bruce, The bottle neck is always the database. 1M reqs/day is 7 reqs/minute. It is not too much but make sure: static files are not served by web2py you cache as much as possible If you need a code review to spot possible problems, let me know. Massimo On Saturday, 7 April 2012 08:59:2

[web2py] Re: Won't DB detect table existence?

2012-04-07 Thread Massimo Di Pierro
Did you change the database password, or something else in the URI string? If so, and if you did not change anything else, set a fake_migration=True to rebuild the *.table for the new URI. On Saturday, 7 April 2012 02:33:32 UTC-5, Ronghui Yu wrote: > > Hi, All, > > I was running my app locally w

[web2py] Re: How to reuse the db definition?

2012-04-07 Thread Massimo Di Pierro
Do not se exec_environment. create a module (not a model) and in it put something like: from gluon import * def define_common_tables(db): request, response, session, cache, T = current.request, current.response, current.session, current.cache, current.T db.define_table('table1',)

[web2py] Scaling web2py

2012-04-07 Thread Bruce Wade
Hi, So now that my site has been developed with web2py I am now looking to release it this month. However also this month we were hit by a sudden increase of members 10,650 new in the last 2 weeks which doesn't look to be slowing down. We are getting around 100,000 - 800,000 ad views a day. Is th

[web2py] Re: contains return no rows of field list:string

2012-04-07 Thread Alan Etkin
I am building some .factory forms with list:string types and took me a time to realize the enter key needed to add new strings. I think that this is confusing, since the enter key is used in other fields to submit the form. I guess that changing this behavior would break apps that were built tha

[web2py] microsoft mvc razor - template engine

2012-04-07 Thread Vasile Ermicioi
just wanted to share http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx To me it looks interesting, is it easy to make something similar to python

[web2py] Hiding columns in SQLFORM.grid

2012-04-07 Thread Keith Edmunds
Is it possible to hide columns in a SQLFORM.grid? I need to retrieve some columns in the query to build some custom links, but I don't want those columns displayed. I've tried setting maxtextlength for those columns to zero, but they still display. Thanks. -- "You can have everything in life you

[web2py] Bug in Cloud SQL with uploads

2012-04-07 Thread Matt
Hi there, I think I've found another bug when using GAE + Cloud SQL. (Note this is assuming you've amended the GoogleSQLAdapter as per another issue) Assuming the following: db.define_table('test', Field('image', 'upload')) def index(): form = SQLFORM.factory(Field('image', 'upload'), _actio

[web2py] Unit testing and faking authentication

2012-04-07 Thread Keith Edmunds
I've been looking that the unit testing page (http://www.web2py.com/AlterEgo/default/show/260), which is very helpful. However, most of my controller functions are decorated with '@auth.requires_login()', and thus if I call them from the test suite, they fail (issuing a redirect): File "/home/ka

[web2py] Won't DB detect table existence?

2012-04-07 Thread Ronghui Yu
Hi, All, I was running my app locally with sqlite on local, but after deployment, I switched to MySQL and Apache with WSGI. The first time it runs well, but after Apache restarted, it reports error below: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. Tracebac