[web2py] Re: Login manually

2012-12-24 Thread Wonton
Hello, Massimo gave me some clues and I think I've found the solution: I was debugging my code and saw that this line: db.auth_user.password.validate(password) returns a 2-tupla: (crypter password, error) In my code (and in all examples I've seen through Internet), this 2-tuple is stored in the

[web2py] strange error

2012-12-24 Thread ctrlSoft
[Errno 1] _ssl.c:503: error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record mac --

[web2py] Unable to load module mod_wsgi on Windows

2012-12-24 Thread at
After adding mod_wsgi in apache2, I am getting following error on apache startup: httpd.exe: Syntax error on line 174 of D:/wamp/bin/apache/apache2.4.2/conf/httpd.conf: Cannot load D:/wamp/bin/apache/apache2.4.2/modules/mod_wsgi_win32.so into server: %1 is not a valid Win32 application. The

[web2py] Re: Login manually

2012-12-24 Thread Wonton
Sorry, I made a mistake. Where I say: passwordAux = db.auth_user.password.validate(password) if passwordAux[1] *!=* None ...insert(..., password=password[0]) I should say: passwordAux = db.auth_user.password.validate(password) if passwordAux[1] *==* None ...insert(..., password=password[0]

[web2py] AttributeError: type object 'Field' has no attribute 'Method'

2012-12-24 Thread Jeff Kusi
I am attempting to use the virtual Methods of the dal but I am running into this issue. Here's my code db.define_table('Posts', db.Field('zipcode'), db.Field.Method('distance',lambda row, loc_zip=3:abs(row .zipcode-loc_zip)) ) But I am running

[web2py] Re: widgets.checkboxes.widget INPUT inside LABLE

2012-12-24 Thread KMax
checkbox widget has styles divs,ul,table So may be new style which will give input inside label would work? Thanks, пятница, 21 декабря 2012 г., 3:58:00 UTC+7 пользователь Anthony написал: > > Good point. It will probably have to depend on the formstyle used. > > Anthony > > On Thursday, December

[web2py] Establishin a session with contrib.WebClient

2012-12-24 Thread Daniel Gonzalez
Hi, I am trying to test my application with WebClient. My application has a non-standard login process, based on a couple of redirects. When login manually in the browser, everything works fine. Taking a look at the requests, I see that after the first redirect a session cookie appears in the r

[web2py] Re: AttributeError: type object 'Field' has no attribute 'Method'

2012-12-24 Thread DenesL
Hi Jeff, I believe you need web2py 2.3.1 or higher for that. On Monday, December 24, 2012 1:36:25 AM UTC-5, Jeff Kusi wrote: > > I am attempting to use the virtual Methods of the dal but I am running > into this issue. Here's my code > db.define_table('Posts', > db.Field('zipco

[web2py] Re: Establishin a session with contrib.WebClient

2012-12-24 Thread Daniel Gonzalez
Trying to answer some of my questions. The redirects are handled by the client. In the case of WebClient probably by the urrlib2 library. Now my question is: how do I tell the urllib2 library used by WebClient to properly setup the cookies when following a redirect? Thanks, Daniel --

[web2py] Re: Using contrib.webclient to test JSONRPC interfaces

2012-12-24 Thread Daniel Gonzalez
Mmm, thanks. I have not taken a look at that yet. I will. Nevertheless, I like the idea of having an integrated client to handle all kind of requests (including jsonrpc), which makes it easier for me for statistics and performance gathering. On Monday, December 24, 2012 6:44:59 AM UTC+1, Massimo

[web2py] Re: Establishin a session with contrib.WebClient

2012-12-24 Thread Daniel Gonzalez
I found a workaround: first send a login request without cookies to *get* the session cookie from web2py, and then do a second login request with the cookie, to give web2py a chance to set the session data. This sets up my tester with a valid session cookie, which corresponds to valid session da

Re: [web2py] Re: calendar.js incompatible with moment.js

2012-12-24 Thread Yarin
Fix looks like it's working- thanks. Glad I was able to stumble upon this issue. (moment.js author Tim Wood confims that calendar.js's .setFullYear was culprit ) On Monday, December 24, 2012 12:10:11 AM UTC-5, Massimo Di Pierro wrote: > > I believe the problem is now fixed. Please check it. > >

Re: [web2py] Re: controller not returning variables

2012-12-24 Thread Jonas Fredriksson
ok, to include everything in the for loop is more elegant. The reason why I wanted to separate the call to sidebar.py is that the sidebar contains almost static material that doesn't change that much, while the main page (index page) has content that changes more. In the first version I had the db

[web2py] fall back for memcached to db caching

2012-12-24 Thread Adi
Tried catching the exception when memcache is not available to switch to db caching, but getting an excepting. Should it be possible to catch this exception, ignore it and continue running? Thanks, Adnan try: from gluon.contrib.memcache import MemcacheClient memcache_servers = ['127

[web2py] Re: OT -- Advice on requiring JS to use site?

2012-12-24 Thread Joe Barnhart
Acutally, I set no such thing. I created my message using the Google Groups interface, and it does not show that message on MY version of the post or its followups. Weird. Maybe Google set something FOR me in one of their many "upgrades" of the Groups feature. -- Joe On Sunday, December 23,

[web2py] Re: The book updates and status

2012-12-24 Thread DenesL
When new features are added to the book they should carry a note of the minimum web2py version that supports them, e.g. Field.Method (since 2.3.1 or 2.3.1+). On Wednesday, December 19, 2012 12:11:55 PM UTC-5, Massimo Di Pierro wrote: > > It would help me if people could add to this thread some

[web2py] Re: Unable to load module mod_wsgi on Windows

2012-12-24 Thread Paolo Caruccio
If you plan to use mod_wsgi 3.4 in apache 2.4 on windows download newest build from http://www.lfd.uci.edu/~gohlke/pythonlibs/ (search in the page for mod_wsgi) If you are interested you could read also https://groups.google.com/d/topic/modwsgi/6nmiDUt0ldI/discussion

[web2py] Re: OT -- Advice on requiring JS to use site?

2012-12-24 Thread Joe Barnhart
Actually, it is not MY fear of Javascript -- it is my potential user who is afraid of it. Numerous "experts" such as http://www.cert.org recommend everybody turn OFF all scripting support, including Javascript, because of the potential of cross-site scripting. Any good web2py'er knows that XSS

Re: [web2py] geodal

2012-12-24 Thread DenesL
The original post (Spatial / GIS support in DAL): https://groups.google.com/d/topic/web2py/feh1ksfdkGk/discussion --

[web2py] Re: Using contrib.webclient to test JSONRPC interfaces

2012-12-24 Thread Massimo Di Pierro
Before we look at implementation. Could you provide an example of you plan to use it. I mean, programmatically, how would you use it? On Monday, 24 December 2012 07:41:18 UTC-6, Daniel Gonzalez wrote: > > Mmm, thanks. I have not taken a look at that yet. I will. > Nevertheless, I like the idea of

[web2py] Re: The book updates and status

2012-12-24 Thread Massimo Di Pierro
Good point. On Monday, 24 December 2012 11:45:05 UTC-6, DenesL wrote: > > > When new features are added to the book they should carry a note of the > minimum web2py version that supports them, e.g. Field.Method (since 2.3.1 > or 2.3.1+). > > > On Wednesday, December 19, 2012 12:11:55 PM UTC-5, M

Re: [web2py] geodal

2012-12-24 Thread Massimo Di Pierro
Thank you Denes. Would you please check my changes. I do not think I broke anything but I tried to make it so that it always returns st_astext if not specified and created Python functions to generate geoPoint/geoLine/geoPolygon. I think it makes code more readable. On Monday, 24 December 2012

[web2py] Concurrent HTTP requests (Ajax call blocking other requests)

2012-12-24 Thread raphael . benedet
Hello, My application performs Ajax calls to dynamically retrieve and display the content of a log. If there is no change (no new lines) to the log compared to the previous Ajax request, the contoller holds the request for up to 5 secs (Ajax long polling). The problem is that when the controller

[web2py] Merry Christmas everybody!

2012-12-24 Thread Massimo Di Pierro
Merry Christmas everybody! --

[web2py] Re: Concurrent HTTP requests (Ajax call blocking other requests)

2012-12-24 Thread Massimo Di Pierro
No this is a "feature" which can be disabled. Web2py serializes all requests from the same user by locking sessions. You can do in your models: if request.ajax: session._unlock(request) Massimo On Monday, 24 December 2012 10:31:57 UTC-6, raphael...@netaxis.be wrote: > > Hello, > My application

Re: [web2py] Merry Christmas everybody!

2012-12-24 Thread Ovidio Marinho
+1 Ovidio Marinho Falcao Neto Web Developer ovidio...@gmail.com ovidiomari...@itjp.net.br ITJP - itjp.net.br 83 8826 9088 - Oi 83 9336 3782 - Claro Brasil 2012/12/24 Massim

[web2py] Re: Merry Christmas everybody!

2012-12-24 Thread Niphlod
+1 slightly early. On Monday, December 24, 2012 7:22:00 PM UTC+1, Massimo Di Pierro wrote: > > Merry Christmas everybody! > --

[web2py] Re: AttributeError: type object 'Field' has no attribute 'Method'

2012-12-24 Thread Jeff Kusi
Thank Denes you that fixed the attribute error issue. So in my controller I'm trying to use the fieldMethod to calcluate a sortby parameter on the fly (not sure if proper approach). My table is defined as: db.define_table('Posts', db.Field('date','datetime',default=request.now,wri

[web2py] Re: Merry Christmas everybody!

2012-12-24 Thread Anthony
+1 Anthony On Monday, December 24, 2012 1:22:00 PM UTC-5, Massimo Di Pierro wrote: > Merry Christmas everybody! --

[web2py] new admin in trunk

2012-12-24 Thread Massimo Di Pierro
As a Christmas present (not from me but from Paolo) there is a new admin in trunk based on Bootstrap. Please check it out. If this is ok we should soon commit 2.4.1 because there are yet more bug fixes. ;-) Massimo --

Re: [web2py] Re: Merry Christmas everybody!

2012-12-24 Thread Bruno Rocha
[image: Inline image 1] --

[web2py] Styling iframe content

2012-12-24 Thread jarrodwilcox
Iframes work well to add multiple internal content pages to a single view, except that I can't seem to link to the web2py css files. The {{ }} processor does not seem to work within an html page called to an iframe. Any thoughts? --

[web2py] Re: Custom form delete Crud checkbox

2012-12-24 Thread Carlos Dañel Ferreyra
Massimo, Do you know if the documentation has been updated to document this property? I got here because I couldn't find this in the book in the first place. Thanks, Carlos. On Tuesday, February 22, 2011 11:28:57 PM UTC-3, Massimo Di Pierro wrote: > > {{=form.custom.deletable}} > > it is not a

[web2py] General iframes question

2012-12-24 Thread jarrodwilcox
Is anyone using iframes to bring in own website content to a view? Web2py finds the pages fine through the URL facility, but does not seem to process them after that. Apologies for duplicate question. Not sure if first one posted correctly. --

[web2py] Re: Custom form delete Crud checkbox

2012-12-24 Thread Massimo Di Pierro
I just added this to the web2py book in trunk. Will push it tomorrow. On Monday, 24 December 2012 15:06:28 UTC-6, Carlos Dañel Ferreyra wrote: > > Massimo, > > Do you know if the documentation has been updated to document this > property? > I got here because I couldn't find this in the book in t

[web2py] Re: fall back for memcached to db caching

2012-12-24 Thread Massimo Di Pierro
Can you try replace: except: with except Exception: On Monday, 24 December 2012 10:04:08 UTC-6, Adi wrote: > > Tried catching the exception when memcache is not available to switch to > db caching, but getting an excepting. > > Should it be possible to catch this exception, ignore it and cont

[web2py] Re: Styling iframe content

2012-12-24 Thread Joe Barnhart
It all seems to work OK for me. Here is an example of a front page that has two IFRAMES and a DIV: {{block head}} section#main {height: 800px;} iframe {height: 700px;} {{end}} {{extend 'layout.html'}} {{=DIV(SQLTABLE(meets,_class="table table-bordered table-condensed"),_class= "span3")}} {{=I

[web2py] Re: Merry Christmas everybody!

2012-12-24 Thread Ron McOuat
+1 Ron McOuat On Monday, 24 December 2012 10:22:00 UTC-8, Massimo Di Pierro wrote: > > Merry Christmas everybody! > --

[web2py] help with finding syntax error in nested if loop in view

2012-12-24 Thread Bhaskar Ramachandran
I get a syntax error for the above code in view html file. I am trying to dynamically insert a tick icon or a cross icon depending on some variables. I tried different ways of expressing the if statements and none of them worked. I followed the book that says we should introduce a pass statem

Re: [web2py] Merry Christmas everybody!

2012-12-24 Thread Roberto Perdomo
Thanks Massimo for your good wishes. May this and all your days are filled with health and wellness and enjoy it in the company of their loved ones. A big hug to everybody. El 24/12/2012 13:52, "Massimo Di Pierro" escribió: Merry Christmas everybody! -- --

[web2py] Re: help with finding syntax error in nested if loop in view

2012-12-24 Thread Paolo Caruccio
"else:" statement is inline with "if" statement. the code wrapped in {{ }} follows python syntax rules. Alternatives below should be work (not tested): A) using ternary operator B) inline syntax with multiple {{ }} C) syntax not in line Il giorno martedì 25 dicembre 2012 00:40:01 UTC+1,

Re: [web2py] help with finding syntax error in nested if loop in view

2012-12-24 Thread Roberto Perdomo
Why not try this: --

Re: [web2py] General iframes question

2012-12-24 Thread Roberto Perdomo
I work with iframes loading form generated by web2py controllers and all works without problems, only session.flash does not show because I remove the include of layout.html but for me is not a problem. El 24/12/2012 16:58, "jarrodwilcox" escribió: > Is anyone using iframes to bring in own websit

[web2py] Re: Merry Christmas everybody!

2012-12-24 Thread samuel bonilla
+1 --

Re: [web2py] Merry Christmas everybody!

2012-12-24 Thread Alec Taylor
+1 Also Happy Chanukah for last week :) On Tue, Dec 25, 2012 at 5:22 AM, Massimo Di Pierro wrote: > Merry Christmas everybody! > > -- > > > --

[web2py] basics of DOM manipulation with web2py

2012-12-24 Thread Bhaskar Ramachandran
I am new to web2py and wondering how i can manipulate elements in a form. This form is in the view file with the form tags all hand coded in html without using the web2py helpers. Now when an user submits this form, i would like to make some decisions based on the user posted information (I coul

[web2py] Re: help with finding syntax error in nested if loop in view

2012-12-24 Thread Bhaskar Ramachandran
Hi Paolo, Roberto, Thank you very much. Paolo, Your response helped me with the issue. Your option A) worked very well!!. Thanks again... However your option B) gave incorrect result. Your That is, it is thinking of the statement as follows: if ... : if . : else

[web2py] Re: help with finding syntax error in nested if loop in view

2012-12-24 Thread Anthony
> > It gets very difficult to apply the if.. else statements in more complex > situations inside the view html code if the basics are not clearly > understood. So i really want to understand the exact new syntax of using > the if... else... in view html files before i start using them more and

[web2py] Re: basics of DOM manipulation with web2py

2012-12-24 Thread Anthony
In web2py, you create a form like: form = SQLFORM(db.mytable).process() In that case, form is the HTML helper object. You would then do something like: form.elements('input') to find all input elements within the form. Anthony On Monday, December 24, 2012 10:46:55 PM UTC-5, Bhaskar Ramachand

[web2py] Re: Styling iframe content

2012-12-24 Thread Anthony
If you want to include multiple internal pages in a single page, you might also consider using componentsvia the LOAD() helper. Anthony On Monday, December 24, 2012 3:41:31 PM UTC-5, jarrodwilcox wrote: > > Iframes work well to add mult

[web2py] Re: OT -- Advice on requiring JS to use site?

2012-12-24 Thread Anthony
> > I just have no feel for how prevalent this fear is, and what percentage of > users has it turned off. A couple years ago, Yahoo! estimated that 2% of the users visiting their US properties had Javascript disabled (the percentages were generally lower for their non-US properties). I would

Re: [web2py] Re: controller not returning variables

2012-12-24 Thread Anthony
I'm not quite clear on your preferred solution. The only thing your sidebar originally got from the controller was the result of a simple query. If you'd really like the entire sidebar to be generated like a full web2py page request, you can make it either an Ajax or non-Ajax component (via the

[web2py] Re: help with finding syntax error in nested if loop in view

2012-12-24 Thread Bhaskar Ramachandran
Hi Anthony, I think it is better to keep these if else (or for or while) statements in separate lines for clarity. Otherwise, it is causing trouble... For example. how would you interpret the statement below This assumes the following logic : if ... : if . : else:

[web2py] Re: basics of DOM manipulation with web2py

2012-12-24 Thread Bhaskar Ramachandran
Hi Anthony, In my case, the form is displaying question, image and 4 choices from a database. Since the database has many other information like answers etc, i decided to customize the form completely by handcoding the html. In between the html, i am having statements like {{=db.quiz[1].Ach

Re: [web2py] Re: basics of DOM manipulation with web2py

2012-12-24 Thread Alec Taylor
Bhaskar: By using the web2py helpers you get a variety of security protections including from: - CSRF - XSS - Code injection You can create custom form attributes that don't appear in your DB also. As for the DOM stuff that you're talking about, listen to Anthony. Also use JavaScript in order to

Re: [web2py] Re: basics of DOM manipulation with web2py

2012-12-24 Thread Bhaskar Ramachandran
Thanks Alec, I understand your point of why using helpers will be good. Since this is my first attempt at web2py, i didn't know that and already have a form that is coded directly in html with db statements spread into it here and there... I can understand why the form object will not exist

Re: [web2py] Re: basics of DOM manipulation with web2py

2012-12-24 Thread Alec Taylor
http://web2py.com/books/default/chapter/29/07 On Tue, Dec 25, 2012 at 4:43 PM, Bhaskar Ramachandran wrote: > Thanks Alec, > > I understand your point of why using helpers will be good. Since this is > my first attempt at web2py, i didn't know that and already have a form that > is coded direc

[web2py] Re: fall back for memcached to db caching

2012-12-24 Thread Adi
Thanks Massimo. The exception works fine, but the problem raised when calling a grid. Didn't realize it's not possible to connect to another session within the "except" segment. Seems that code has to be outside. Still learning python here :) db.py - try: from gluon.contrib.memcache im

[web2py] Re: fall back for memcached to db caching

2012-12-24 Thread Massimo Di Pierro
I am not sure I fully understand the problem. One issue is that you cannot do: try: redirect(url) except: something you have to do try: redirect(url) except HTTP, e: raise e except: db.rollback() # maybe something because a redirect will raise HTTP which ext

Re: [web2py] Merry Christmas everybody!

2012-12-24 Thread ゴー・ニコライ
Happy Festivus! On Tuesday, December 25, 2012, Massimo Di Pierro wrote: > Merry Christmas everybody! > > -- > > > > --