[web2py] Re: ssh tunnel to admin panel with lighttpd= ERROR:web2py.cache:corrupted file

2012-01-29 Thread Benjamin
Hello Massimo, Unfortunately it doesn't solve it. There is from time to time only 2 files in this cache folder : cache.lock cache.shelve And deleting it doesn't change the behavior, i.e.: the web2py welcome page is displayed correctly using an SSH tunnel but the admin panel displays Internal

[web2py] TIP: function to help with common filter usage

2012-01-29 Thread guruyaya
I wrote this function, to help out with a project I'm working on, that has an extensive use of the common filter functionality (describes in chapter 6 of the web2py book). Say you have a blog, containing active, and inactive posts: db.define_table('post', Field('subject'), Field('post','text'),

[web2py] Re: TIP: function to help with common filter usage

2012-01-29 Thread guruyaya
I've made a mistake in my tip, please replace: db.comment._common_filter = inherit_common_filter(db, db.comment) with: db.comment._common_filter = inherit_common_filter(db, db.comment.post) Sorry for this one. On Jan 29, 10:46 am, guruyaya guruy...@gmail.com wrote: I wrote this function,

[web2py] Re: ssh tunnel to admin panel with lighttpd= ERROR:web2py.cache:corrupted file

2012-01-29 Thread Benjamin
Hello, Just to let you know ISSUE SOLVED. For an unknown reason sessions folder was not chown to www-data, so simply : chown -R www-data:www-data sessions solved the issue. I am not sure it's the way it should be but at least it works now. Thanks, Cheers, On 29 jan, 09:41, Benjamin

[web2py] Re: Any advice on spam control for a comment system?

2012-01-29 Thread Benjamin
Hi, Personally I like human quiz anti-bot measures. Captcha can be breaken easily. e.g. you could build yourself a big list of questions and ask for the answer before validating the comment form. Of course the answer should not be a simple yes/no quiz. questions like : What color is not on the

[web2py] Re: Is it possible to LOAD a component after a page has rendered?

2012-01-29 Thread scausten
Thanks! web2py easy, as always. On Jan 28, 11:24 am, Alan Etkin spame...@gmail.com wrote: You can use javascript onclick and the web2py.js function web2py_component(action,target) to load the source on demand. You need to set a target div or other element in the view previously and get the

Re: [web2py] Many apps but only one needs https.

2012-01-29 Thread Alexandre Andrade
while https can be used for everyone, u can force https just to one. Em 28 de janeiro de 2012 12:51, António Ramos ramstei...@gmail.comescreveu: Hello, if i have 20 apps in the same server of web2py and only one needs to be accessed with https what do i do? Thank you António --

[web2py] Mobile OTP authentication (motp) plugin for web2py

2012-01-29 Thread whowhywhat
just finished writing a motp (http://motp.sourceforge.net/) authentication plugin for web2py. Where do i contribute this code? I would appreciate if some one tests this and gives me some feedback. I have uploaded the code to Google code. project is https://web2py-motp-auth.googlecode.com you can

[web2py] Re: TIP: function to help with common filter usage

2012-01-29 Thread whowhywhat
nice tip. thanks for sharing! On Jan 29, 1:51 pm, guruyaya guruy...@gmail.com wrote: I've made a mistake in my tip, please replace:    db.comment._common_filter = inherit_common_filter(db, db.comment) with:    db.comment._common_filter = inherit_common_filter(db, db.comment.post) Sorry for

[web2py] Clean session after logout

2012-01-29 Thread Bruno Rocha
I want to clean session (remove / delete) the session file *auth.settings.logout_onlogout = lambda user: remove_session(user)* def remove_session(user): Does anybody implemented that kind of function? I will wait for someone to share it before starting code my own... --

[web2py] Re: ticket with book example under 7.2.6 Links to Referencing Records

2012-01-29 Thread DenesL
It gives a different error using trunk: Traceback (most recent call last): File C:\w2p\trunk\gluon\restricted.py, line 204, in restricted exec ccode in environment File C:/w2p/trunk/applications/test/controllers/test.py, line 21, in module File C:\w2p\trunk\gluon\globals.py, line 172,

[web2py] Re: Mobile OTP authentication (motp) plugin for web2py

2012-01-29 Thread Massimo Di Pierro
Please email me a patch. The files would go into contrib. Thank you for this contribution. :-) Massimo On Jan 29, 6:53 am, whowhywhat mads...@gmail.com wrote: just finished writing a motp (http://motp.sourceforge.net/) authentication plugin for web2py. Where do i contribute this code? I would

[web2py] Re: Clean session after logout

2012-01-29 Thread Massimo Di Pierro
auth.settings.logout_onlogout = lambda user: session.clear() On Jan 29, 7:35 am, Bruno Rocha rochacbr...@gmail.com wrote: I want to clean session (remove / delete) the session file *auth.settings.logout_onlogout = lambda user: remove_session(user)* def remove_session(user):    

[web2py] Re: Clean session after logout

2012-01-29 Thread Massimo Di Pierro
If you want to actually remove the file you can try: def remove_session(user): session._unlock(response) os.unlink(response.session_filename) session.clear() I am not 100% sure. On Jan 29, 7:35 am, Bruno Rocha rochacbr...@gmail.com wrote: I want to clean session (remove /

[web2py] help with js issue

2012-01-29 Thread Massimo Di Pierro
I would like to post web2py 2.0 since we have no major pending issues. Yet there are two issues I would like to fix first: http://code.google.com/p/web2py/issues/detail?id=627 I used to be able to stop the server with CRTL+C but it does not work anymore on my mac. I now have to kill it. Why? I

Re: [web2py] help with js issue

2012-01-29 Thread Bruno Rocha
the same for me, I always have to kill - 9 PID. But it only happens after some time. http://zerp.ly/rochacbruno Em 29/01/2012 14:27, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: I would like to post web2py 2.0 since we have no major pending issues. Yet there are two issues I would

Re: [web2py] help with js issue

2012-01-29 Thread Ovidio Marinho
Ctrl+C in Mac is Cmd+C Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9334 0266 - Claro Brasil

Re: [web2py] help with js issue

2012-01-29 Thread Jonathan Lundell
On Jan 29, 2012, at 10:44 AM, Ovidio Marinho wrote: Ctrl+C in Mac is Cmd+C It is for copy, but not for quitting a process from the terminal. Control-C. Massimo, are you sure web2py isn't running in the background when you do this? If you hit return, do you get a shell prompt? Control-C won't

Re: [web2py] help with js issue

2012-01-29 Thread Ricardo Pedroso
On Sun, Jan 29, 2012 at 4:27 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I used to be able to stop the server with CRTL+C but it does not work anymore on my mac. I now have to kill it. Why? I'm new to web2py, but I already see this happened in other scripts when working with

Re: [web2py] help with js issue

2012-01-29 Thread Michele Comitini
Yes probably some system call hangs somewhere. 2012/1/29 Ricardo Pedroso rmdpedr...@gmail.com: On Sun, Jan 29, 2012 at 4:27 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I used to be able to stop the server with CRTL+C but it does not work anymore on my mac. I now have to kill it.

Re: [web2py] Re: Soliciting freelance developers

2012-01-29 Thread Bruce Wade
How do I get my company listed on http://www.web2py.com/examples/default/support ? Now that I have two developers, and 2 designers working with me on porting a few applications over to web2py I think that I will be using the framework strictly for new client development at

Re: [web2py] Re: Nginx + uwsgi file download problem

2012-01-29 Thread Roberto De Ioris
Hard to say. I don't know if this helps but here's how appadmin does it for a csv file: def csv(): import gluon.contenttype response.headers['Content-Type'] = \ gluon.contenttype.contenttype('.csv') db = get_database(request) query = get_query(request) if

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Magnitus
Making some inroads. The file type returned in the HTTP header for audio files is this: text/plain; charset=utf-8 Accoding to this article, Firefox is actually the correct implementation amongst the browsers for this, because it respects the file type indicated by the server:

Re: [web2py] Re: Soliciting freelance developers

2012-01-29 Thread Kenneth Lundström
If you havn't gotten a reply by Massimo by now you can email him directly. You can find his address on quite a few posts in this group. Kenneth How do I get my company listed on http://www.web2py.com/examples/default/support ? Now that I have two developers, and 2 designers working with

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Magnitus
The problem is with web2py. I changed 'contenttype.py' in gluon and added '.webm': 'video/webm' to the list. If the necessary changes could be made to the trunk so that I don't have to do the above modification to my copy each time I download the latest version of the framework, it would be

Re: [web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Jonathan Lundell
On Jan 29, 2012, at 1:49 PM, Magnitus wrote: The problem is with web2py. I changed 'contenttype.py' in gluon and added '.webm': 'video/webm' to the list. If the necessary changes could be made to the trunk so that I don't have to do the above modification to my copy each time I

Re: [web2py] Many apps but only one needs https.

2012-01-29 Thread António Ramos
How? 2012/1/29 Alexandre Andrade alexandrema...@gmail.com while https can be used for everyone, u can force https just to one. Em 28 de janeiro de 2012 12:51, António Ramos ramstei...@gmail.comescreveu: Hello, if i have 20 apps in the same server of web2py and only one needs to be

Re: [web2py] Re: Soliciting freelance developers

2012-01-29 Thread Bruce Wade
Ok thanks I will email him directly. -- Regards, Bruce 2012/1/29 Kenneth Lundström kenneth.t.lundst...@gmail.com If you havn't gotten a reply by Massimo by now you can email him directly. You can find his address on quite a few posts in this group. Kenneth How do I get my company

[web2py] Nesting HTML tables

2012-01-29 Thread Tsvi Mostovicz
Hi all, I'm trying to get the following HTML structure using HTML helpers: tablethead.../thead tbody.../tbody tablethead.../thead tbody.../tbody /table/table AKA nested tables. For some reason when I put the TABLE helper within another TABLE helper, the internal one gets surrounded by tbody, tr

Re: [web2py] Nesting HTML tables

2012-01-29 Thread Marin Pranjić
Shouldn't second table go inside td ... /td if you want nested tables ? Shouldn't anything inside table be inside td ... /td ? I don't understand your wanted structure. It is not valid or am I missing something? Marin On Sun, Jan 29, 2012 at 10:10 PM, Tsvi Mostovicz ttm...@gmail.com wrote:

[web2py] Re: Nesting HTML tables

2012-01-29 Thread Alan Etkin
Have you tried passing table components as arguments? TABLE(THEAD(), TBODY(), THEAD(), TBODY(), ...) You could explore each table helper instance and extract the parts you want to nest and then in a view do something like this: table {{ for table in tables:}} {{ table.elements(thead)[0] }} {{

[web2py] select data from database using date

2012-01-29 Thread Sanjeet roy
I have one date column due_date here i want to select the all data between dates one is starting date and one is end date both are taken manually so if the user select cmnpny and start and end date all the data related to company between choosen date should be come my code is below but i don't

[web2py] Re: Mobile OTP authentication (motp) plugin for web2py

2012-01-29 Thread Alan Etkin
does web2py have a standard AES api? i would like to (symmetrically) encrypt the stored motp pin and motp secret. Or is it better i just use a external python library? There is a CRYPT helper object of web2py that can be instanitated with different options. It is used for standard

[web2py] Re: help with js issue

2012-01-29 Thread Massimo Di Pierro
Yes I am sure it is not running in background. Recently I started having two problems and I cannot track them down. 1) on 10.6.8 I cannot quit with ctrl+C 2) on Lion is keeps printing '^@' to console, about one per minute. I suspect these problems are related and bother me very much. I cannot

[web2py] Re: help with js issue

2012-01-29 Thread Massimo Di Pierro
I fixed issue 627. The other issue is still open. On Jan 29, 10:27 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: I would like to post web2py 2.0 since we have no major pending issues. Yet there are two issues I would like to fix first:

Re: [web2py] select data from database using date

2012-01-29 Thread Bruce Wade
query = db(db.f_company_compliance.company == session.company) query = query((db.f_company_compliance.due_date = session.strtdate) (db.f_company_compliance.due_date = session.enddate)) rows = query.select() for row in rows: # do something On Sun, Jan 29, 2012 at 10:22 AM, Sanjeet roy

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Massimo Di Pierro
adding to trunk. On Jan 29, 2:12 pm, Jonathan Lundell jlund...@pobox.com wrote: On Jan 29, 2012, at 1:49 PM, Magnitus wrote: The problem is with web2py. I changed 'contenttype.py' in gluon and added '.webm': 'video/webm' to the list. If the necessary changes could be made to the

[web2py] Re: Soliciting freelance developers

2012-01-29 Thread Massimo Di Pierro
The policy is simple. If you have a business and you have a web site that says you provide web2py support just ask and I will add you. If you can claim projects already built with web2py, please also send me those links. I also encourage people to apply for membership to expert4solutions.com.

[web2py] Re: select data from database using date

2012-01-29 Thread Alan Etkin
I belive the and operator is not used with query expressions. I think the proper intersection is query1 query2... queryN On 29 ene, 15:22, Sanjeet roy kumarsanjeet1...@gmail.com wrote: I have one date column due_date here i want to select the all data between dates one is starting date and

[web2py] Re: help with js issue

2012-01-29 Thread Alan Etkin
On Mandriva Linux Free 2010 (32 bit) with KDE desktop I get a message when I stop rocket with Ctrl-C: unknown program name(10129)/ ClientApp::doIt: Creating ClientApp kioclient(10129) ClientApp::kde_open: KUrl(http://127.0.0.1:8000;) ^CUnhandled exception in thread started by Error in

[web2py] Re: 'Morsel' object has no attribute 'split' ?

2012-01-29 Thread Alan Etkin
Cant't you just modify the interface code to get the expected string input? It seems that the input data is stored in the Morsel instance. On 29 ene, 04:11, Ben Tammetta b...@clubelite.com wrote: Hello, I am using the code provided here to create a web2py facebook

[web2py] SQLFORM.grid: search and links

2012-01-29 Thread backseat
I've a couple of questions about SQLFORM.grid: - Is it possible to position the buttons/links created by the 'links' argument somewhere other than the end of the row? It feels as if the 'fields' argument should be able to do this, but I can't see how. - Is it possible for the 'search' box to

[web2py] Re: Nesting HTML tables

2012-01-29 Thread DenesL
Can we see the code? In the following example no tbody is added to the inner table: t=TABLE(*[TR(TABLE( *[ TR(*[1,2,3]), TR(*[4,5,6])] )),TR()]) print t tabletrtdtabletrtd1/tdtd2/tdtd3/td/ trtrtd4/tdtd5/tdtd6/td/tr/table/td/trtr/tr/ table or nicely formatted: table tr td table

[web2py] Removing need for first and last name in auth

2012-01-29 Thread HittingSmoke
I'd like to use auth with only a username instead of first and last name. I defined my own tables without a first and last name but it still causes issues throughout the app. For instance, when I try to use appadmin to add a user to a new auth group I get an error (type 'exceptions.KeyError'

[web2py] Re: Removing need for first and last name in auth

2012-01-29 Thread Massimo Di Pierro
I suggest you simply make the fields hidden db.auth_user.first_name.readable = db.auth_user.first_name.writable = False db.auth_user.last_name.readable = db.auth_user.last_name.writable = False On Jan 29, 6:36 pm, HittingSmoke hittingsm...@gmail.com wrote: I'd like to use auth with only a

[web2py] new feature in trunk ... help test

2012-01-29 Thread Massimo Di Pierro
auth.mygroups is a dictionary of (key,value) = (group_id,role) This makes it easy to create objects like db.define_table('thing', Field('name'), Field('groups_with_access','list:reference auth_group')) and select them with mythings =

Re: [web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Anthony
You could also try: from gluon.contenttype import CONTENT_TYPE CONTENT_TYPE['.webm'] = 'video/webm' presumably early in db.py, depending on when it was needed. Unless that's too late in some case. Static files are served before hitting the app code, but should work for other downloads.

Re: [web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread LightDot
This brings back memories. I believe I may have had a similar problem recently. Apache mod_wsgi, web2py 1.99.2. I wanted to use css3pie to overcome IE8 and IE9 lack of CSS3 support. IE8 is easy going, but IE9 strictly demands a correct file-type for the PIE.htc behaviour file in order to use

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Massimo Di Pierro
You have to tell web2py what do to with the file. If the file is in static and served by web2py you should download it with http:///filename?attachment if it is served by your controller you must set the reponse.header['content-disposition']. On Jan 29, 8:25 pm, LightDot

Re: [web2py] new feature in trunk ... help test

2012-01-29 Thread Bruno Rocha
I like the idea. Currently I am loading user groups on login. I just think it have to be called auth.user_groups so it will be more compatible with auth.user_id http://zerp.ly/rochacbruno Em 29/01/2012 23:17, Massimo Di Pierro massimo.dipie...@gmail.com escreveu: auth.mygroups is a

[web2py] hollywoodr.js

2012-01-29 Thread Massimo Di Pierro
https://github.com/magnusvw/hollywoodr

Re: [web2py] select data from database using date

2012-01-29 Thread Sanjeet roy
Thanks Bruce My Problem is solved

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread LightDot
First, I apologize for stealing a thread a bit, but this seems to be related to the original issue. This group is a wealth of knowledge so I guess it doesn't hurt to document this here... In the case of PIE.htc, it only needs a proper content-type and it needs to be referenced in the css (I'm

Re: [web2py] select data from database using date

2012-01-29 Thread Bruce Wade
No problem any time. On Sun, Jan 29, 2012 at 7:35 PM, Sanjeet roy kumarsanjeet1...@gmail.comwrote: Thanks Bruce My Problem is solved -- -- Regards, Bruce Wade http://ca.linkedin.com/in/brucelwade http://www.wadecybertech.com http://www.warplydesigned.com

Re: [web2py] Re: help with js issue

2012-01-29 Thread Jonathan Lundell
On Jan 29, 2012, at 4:23 PM, Massimo Di Pierro wrote: Yes I am sure it is not running in background. Recently I started having two problems and I cannot track them down. 1) on 10.6.8 I cannot quit with ctrl+C 2) on Lion is keeps printing '^@' to console, about one per minute. I suspect

Re: [web2py] Re: help with js issue

2012-01-29 Thread Jonathan Lundell
On Jan 29, 2012, at 4:23 PM, Massimo Di Pierro wrote: Yes I am sure it is not running in background. Recently I started having two problems and I cannot track them down. 1) on 10.6.8 I cannot quit with ctrl+C 2) on Lion is keeps printing '^@' to console, about one per minute. I suspect

[web2py] Re: new feature in trunk ... help test

2012-01-29 Thread Massimo Di Pierro
Done. I also think we need a mechanism to give permissions to users about groups. The auth_permission works well to give permissions about objects and other tables but not about groups themselves. For example consider the permission to manage a group. If we do

[web2py] Re: Problem with the audio tag, web2py and Firefox

2012-01-29 Thread Magnitus
Well, thank you for the support :). I realize that the html5 codecs situation is a bit of a mess at the present. @Lightdot: It's always reassuring to know you're not the only one who tripped over this. Sometimes, I feel like I should know the Framework inside out after having used it for

[web2py] New in trunk - disabling menu items

2012-01-29 Thread guruyaya
Say you have a response.menu, that goes response.menu = [ (T('Home'), False, URL('default','index'), [ (T('Looged In stuff'), False, URL('default','index')) ]), (T('Logged in menu'), False, URL('default','index'), [ (T('Menu Item'), False, URL('default','index')) ])

Re: [web2py] Web2py in large web scenarios

2012-01-29 Thread Johann Spies
On 27 January 2012 20:24, Bruno Rocha rochacbr...@gmail.com wrote: I also noted best performance directly rendering the templates and caching views where it can be cached. just replacing return dict() with return response.render(filename, context) Is there documentation about this?

Re: [web2py] Web2py in large web scenarios

2012-01-29 Thread Johann Spies
On 28 January 2012 01:06, Michele Comitini michele.comit...@gmail.comwrote: About db bottlenecks: I think that using executesql gives a performance gain of 2 orders of magnitude over DAL on datasets with more than 1000 records. The DAL is a huge bottleneck if used inappropriately. I

Re: [web2py] Re: ssh tunnel to admin panel with lighttpd= ERROR:web2py.cache:corrupted file

2012-01-29 Thread nils
Hi, . Lighty runs under the user of www-data and so folders or files that need to be written too, have to have the ownership changed to www-data other wise you will get this error, same goes for a download/upload folder if you are uploading content via your application. Regards, Nils On Sun,