Re: [web2py] Re: Chrome:LOAD and ajax problem

2012-08-03 Thread tomasz bandura
Hello, After investigation, i added error handler to web2py_ajax_page and the error's result was: function AjaxFailed(result) { alert("FAILED : " + result.status + ' ' + result.statusText); } and the result: result.status:0 result.statusText): 'error' It looks rather as a jquery iss

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-08-03 Thread Luther Goh Lu Feng
In django, the derivaties are called Open Source Django Projects and described as stand-alone applications written using Django. They also have classifications into categories based on functionalities in the list. Is this something that can be useful to web2py? https://code.djangoproject.com/wi

Re: [web2py] Re: A Web2py CMS like Joomla ?

2012-08-03 Thread Anthony
On Friday, August 3, 2012 5:28:28 AM UTC-4, Luther Goh Lu Feng wrote: > > In django, the derivaties are called Open Source Django Projects and > described as stand-alone applications written using Django. They also > have classifications into categories based on functionalities in the list. > Is

Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-03 Thread Martin Weissenboeck
Sorry, my tests were wrong. Please forget my last mail. I think I have mixed two versions on my computer. I have tested it again and now is_imperonating works as expected. Thank you! 2012/8/3 Massimo Di Pierro > Clearly there is a problem with that function. If auth is defined, I'd > expect > >

Re: [web2py] Re: LEFT JOIN query issues

2012-08-03 Thread Larry G. Wapnitsky
grrr ...there's always something in a programming language! Thanks, Limedrop On 8/2/2012 5:43 PM, Limedrop wrote: This gets me every now and then... In python it should be "==" rather than "=" |left=db.mr_link.on(db.mr_link.recipID==db.recipient.id))| On Friday, August 3, 2012 8:08:38 AM UT

[web2py] Re: Can't run web2py because of socket.gethostbyname problem

2012-08-03 Thread Mobility
I am not getting host name. I can run web2py on local host. When I go to my test deployment machine with ML Server I first get an error saying that wsgihandler.py file does not have exec permission. After I give permission on the file, chmod a+x, it says gives me an error saying premature end of

Re: [web2py] Re: is_impersonating() as boolean in menu

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 4:50 AM, Martin Weissenboeck wrote: > Sorry, my tests were wrong. Please forget my last mail. > I think I have mixed two versions on my computer. I have tested it again and > now is_imperonating works as expected. > Thank you! That's good. I've been trying to reproduce it in a

Re: [web2py] Re: LEFT JOIN query issues

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 5:08 AM, "Larry G. Wapnitsky" wrote: > grrr ...there's always something in a programming language! I blame SQL... > > Thanks, Limedrop > > On 8/2/2012 5:43 PM, Limedrop wrote: >> This gets me every now and then... >> >> In python it should be "==" rather than "=" >> >> le

Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-08-03 Thread Alan Etkin
> > On Thursday, June 7, 2012 6:35:19 PM UTC-7, JoeCodeswell wrote: >> >> Hi Noel, >> >> I had this problem occur AGAIN, TODAY on WebFaction, when I upgraded to >> Version 1.99.7 (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 >> (Unix) mod_wsgi/3.3 Python/2.7.3. When creating a new simpl

Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 7:13 AM, Alan Etkin wrote: > On Thursday, June 7, 2012 6:35:19 PM UTC-7, JoeCodeswell wrote: > Hi Noel, > > I had this problem occur AGAIN, TODAY on WebFaction, when I upgraded to > Version 1.99.7 (2012-03-04 22:12:08) stable, Running on Apache/2.2.17 (Unix) > mod_wsgi/3.3 Pyt

[web2py] Webservice for web widgets: security

2012-08-03 Thread Tito Garrido
Hi Folks, I have created a jsonp function that will be used on a script so some other people could use widgets with just 2 lines like: http://example.com/widget/script.js"; type="text/javascript"> This script will call the jsonp function using: $.getJSON(widget_url, function(data) { $('#e

Re: [web2py] Re: Question about a section of the book.

2012-08-03 Thread Toby Shepard
On 08/02/2012 12:29 PM, Niphlod wrote: formname='something' serializes within the form a hidden input, so web2py can distinguish what form is being submitted. If the submitted values were to be serialized as urlencoded, just to explain, for the first form would be name=value&formname=form_one a

Re: [web2py] Re: Subclass FORM?

2012-08-03 Thread Toby Shepard
def __init__(self): super(Document, self).__init__(self) Don't pass self to __init__() -- should be: Ahh... much better. Thanks! Tobiah --

Re: [web2py] Re: web2py still unable to create application on WebFaction

2012-08-03 Thread Alan Etkin
> > I didn't check the shell syntax, but you get the idea. > > > if [ -f NEWINSTALL -a -d applications/welcome ]; then > >python -c "from gluon.fileutils import w2p_pack; > w2p_pack('welcome.w2p','applications/welcome')" > >rm NEWINSTALL > > fi > Looks ok, I found this alte

Re: [web2py] Re: Question about a section of the book.

2012-08-03 Thread Anthony
> > I would have to assume that the hiddens are only generated > because of the call to FORM.accepted(). Correct. FORM.process() ultimately calls FORM.accepts(), which adds a "formname" attribute. When the form is serialized in the view, the FORM.xml() method calls FORM.hidden_fields(), which

[web2py] run code only if you are a worker

2012-08-03 Thread Vincenzo Ampolo
Hi, I've an import that takes too much time and resources. Basically it sets up a NLTK tagger. I need this feature imported only if I'm runing as a worker. If I'm running the webserver or the shell I don't need that import at all. Is there a way to detect if I'm a worker when the models/modules

[web2py] Apache vhost configuration for web2py with mod_wsgi and SSL

2012-08-03 Thread Daniel Gonzalez
Hi, I am trying to setup an apache vhost with SSL to serve web2py. I have succeeded in setting up mod_wsgi, with the following vhost configuration file: ServerName www.example.com WSGIDaemonProcess web2py user=www-data group=www-data \ display-name=%{GROUP} W

Re: [web2py] Webservice for web widgets: security

2012-08-03 Thread Bruno Rocha
I think you can generate a KEY in script.js (you need to generate this file dynamically) So you will have a key to check back when the widget gets rendered. On Fri, Aug 3, 2012 at 12:31 PM, Tito Garrido wrote: > Hi Folks, > > I have created a jsonp function that will be used on a script so some

Re: [web2py] Apache vhost configuration for web2py with mod_wsgi and SSL

2012-08-03 Thread Alec Taylor
You should be able to find all the relevant information here: http://web2py.com/book/default/chapter/13 On Sat, Aug 4, 2012 at 2:58 AM, Daniel Gonzalez wrote: > Hi, > > I am trying to setup an apache vhost with SSL to serve web2py. I have > succeeded in setting up mod_wsgi, with the following vh

[web2py] Re: Webservice for web widgets: security

2012-08-03 Thread Anthony
You might consider using CORS: http://www.html5rocks.com/en/tutorials/cors/ Anthony On Friday, August 3, 2012 11:31:04 AM UTC-4, Tito Garrido wrote: > > Hi Folks, > > I have created a jsonp function that will be used on a script so some > other people could use widgets with just 2 lines like: >

[web2py] Re: run code only if you are a worker

2012-08-03 Thread Niphlod
never had this kind of requirement, so at the moment there's no such possibility. Just my 2 cents (and if this results unfeasible I'll think about more, please bear with me for a moment) For my current understanding, if you put that "megacall" into modules, when the webserver is started (i.e. y

[web2py] IS_DATETIME_IN_RANGE validation error datetime format

2012-08-03 Thread Shane Tzen
There seems to be a unexpected behavior regarding the form validation error datetime format. In languages/en-us.py, I redefined '%Y-%m-%d %H:%M:%S' to '%m-%d-%Y %I:%M %p'. views/web2py_ajax.html says var w2p_ajax_datetime_format = "{{=T('%Y-%m-%d %H:%M:%S')}}";. Even though the calendar widget g

[web2py] Re: run code only if you are a worker

2012-08-03 Thread Anthony
I think when you run web2py with the -K option, request.global_settings.scheduler exists and is set to the name/names of the apps passed after the -K option (otherwise, it should be None). Anthony On Friday, August 3, 2012 12:50:33 PM UTC-4, Vincenzo Ampolo wrote: > > Hi, > > I've an import th

[web2py] Re: run code only if you are a worker

2012-08-03 Thread Niphlod
the nicest feature! TY Anthony, I didn't know about request.global_settings! PS: could we add that on the wiki at the http://web2py.com/books/default/chapter/29/4#request section so we don't forget about it ? On Friday, August 3, 2012 10:16:36 PM UTC+2, Anthony wrote: > > I think when you run w

[web2py] Web2py service won't start on Windows

2012-08-03 Thread joe
Hello I am running apache on a dedicated windows server (2008). As of this morning, it was running successfully as a process. But it needs to be a service, and that is causing me a 404 error. Basically, apache runs just fine as a service, but when I install and start web2py as a service, it

[web2py] Re: run code only if you are a worker

2012-08-03 Thread Anthony
There's also request.global_settings.cronjob. On Friday, August 3, 2012 4:52:28 PM UTC-4, Niphlod wrote: > > the nicest feature! TY Anthony, I didn't know about > request.global_settings! > > PS: could we add that on the wiki at the > http://web2py.com/books/default/chapter/29/4#request section

[web2py] Re: Web2py service won't start on Windows

2012-08-03 Thread LightDot
My guess is that you have Apache and Rocket (web2py's internal web server) both claiming port 443 at the same time. Do you want to use Apache to run web2py or..? Regards, Ales On Friday, August 3, 2012 11:40:34 PM UTC+2, joe wrote: > > > Hello > > I am running apache on a dedicated windows ser

[web2py] strange response.flash

2012-08-03 Thread Martin Weissenboeck
I have tried:* response.flash="Auswählen"* (German for "select") and I got * "Ausw%C3%A4hlen"*. Looks like urllib.quote, but why? And in some other contexts I got "*Auswählen*" as expected. I could not find any rule. I am using the trunk from yesterday. Then I wrote some test functions. I have w

[web2py] Re: strange response.flash

2012-08-03 Thread Anthony
This issue is not with response.flash but with request.args. The characters allowed in args are fairly restrictive -- here are the regexes used: http://code.google.com/p/web2py/source/browse/gluon/rewrite.py#51, http://code.google.com/p/web2py/source/browse/gluon/rewrite.py#575. In the LOAD() e

[web2py] Re: Centos 5 script for Nginx with Uwsgi and Web2py

2012-08-03 Thread Alan Etkin
Updated the script to: - Write port 443 admin password - Create welcome.w2p package (for solving admin create app feature error) - Patch Python2.7.3 code for sqlite3 issue before installing It was tested with a clean CentOS 5.8 vbox and is working. Needs improvement: it stops a few times for use

[web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
Just wondering if anyone has a solution to this. I have an if statement in a view: {{if conditionA == True:}} {{for obj in ListA:}} {{=obj}} {{pass}} {{pass}} This works fine. Now, if I add another condition to the if statement, that I know exists: {{if conditionA == True and conditionB==Tru

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 4:34 PM, adohertyd wrote: > Just wondering if anyone has a solution to this. I have an if statement in a > view: > > {{if conditionA == True:}} > {{for obj in ListA:}} > {{=obj}} > {{pass}} > {{pass}} > > > > This works fine. Now, if I add another condition to the if stateme

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
Yes that's correct. The data comes from a radio button so the 2 conditions are always true or false (boolean) On Saturday, 4 August 2012 00:40:53 UTC+1, Jonathan Lundell wrote: > > On 3 Aug 2012, at 4:34 PM, adohertyd wrote: > > Just wondering if anyone has a solution to this. I have an if statem

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 4:45 PM, adohertyd wrote: > Yes that's correct. The data comes from a radio button so the 2 conditions > are always true or false (boolean) Just for laughs you could try if conditionA and conditionB: > > On Saturday, 4 August 2012 00:40:53 UTC+1, Jonathan Lundell wrote: >

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread adohertyd
Woops! I've done a double check, the results are not boolean. I've assigned 'Yes' and 'No' to each button. Still though, the error remains. {{if conditionA=="Yes" and conditionB=="Yes"}} returns nothing but {{if conditionA=="Yes"}} returns output. The problem is definitely the multiple condi

Re: [web2py] if statement with multiple conditions in view

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 4:55 PM, adohertyd wrote: > Woops! I've done a double check, the results are not boolean. I've assigned > 'Yes' and 'No' to each button. Still though, the error remains. > > {{if conditionA=="Yes" and conditionB=="Yes"}} > > returns nothing but > > {{if conditionA=="Yes"}}

[web2py] Re: if statement with multiple conditions in view

2012-08-03 Thread Anthony
Multiple condition if statements work fine in views. Try: {{if 'yes'=='yes' and 'yes'=='yes':}} The problem is likely in your code -- conditionB probably isn't equal to "Yes" when you think it is. Perhaps if you show more code we can figure it out. Anthony On Friday, August 3, 2012 7:34:50 PM

[web2py] Re: if statement with multiple conditions in view

2012-08-03 Thread adohertyd
I'm sorry guys I'm an idiot. I've just spotted my mistake in the code. It was a naming error leaving ConditionB not being assigned. Sorry for wasting your time thanks for the help. On Saturday, 4 August 2012 00:34:50 UTC+1, adohertyd wrote: > > Just wondering if anyone has a solution to this. I

Re: [web2py] Re: run code only if you are a worker

2012-08-03 Thread Vincenzo Ampolo
On 08/03/2012 02:53 PM, Anthony wrote: > There's also request.global_settings.cronjob. Cool but where do I've request available? It's not at import time but i've a request object in web2py.py -M -S milo So when can i know that request is a valid object? Thanks Niphlod for your help but the worka

Re: [web2py] run code only if you are a worker

2012-08-03 Thread Jonathan Lundell
On 3 Aug 2012, at 5:23 PM, Vincenzo Ampolo wrote: > > On 08/03/2012 02:53 PM, Anthony wrote: >> There's also request.global_settings.cronjob. > > Cool but where do I've request available? It's not at import time but > i've a request object in web2py.py -M -S milo > > So when can i know that req

Re: [web2py] Re: run code only if you are a worker

2012-08-03 Thread Anthony
> > On 08/03/2012 02:53 PM, Anthony wrote: > > There's also request.global_settings.cronjob. > > Cool but where do I've request available? It's not at import time but > i've a request object in web2py.py -M -S milo > > So when can i know that request is a valid object? > When you said "worker

Re: [web2py] Re: run code only if you are a worker

2012-08-03 Thread Anthony
In general, have a look at the contents of request.global_settings.cmd_options -- it includes the various command line options specified when starting web2py. Anthony On Friday, August 3, 2012 9:13:56 PM UTC-4, Anthony wrote: > > On 08/03/2012 02:53 PM, Anthony wrote: >> > There's also request

Re: [web2py] Re: run code only if you are a worker

2012-08-03 Thread Vincenzo Ampolo
On 08/03/2012 06:13 PM, Anthony wrote: > When you said "worker", I assumed you were using the web2py Scheduler -- > is that the case? If so, you can put something like the following in the > model or controller that does the import: > > | > ifrequest.global_settings.scheduler: > [dothe time-co

Re: [web2py] Re: run code only if you are a worker

2012-08-03 Thread Anthony
> > I was referring of a module in applications/milo/modules that is used in > a applications/milo/models > > When the import is done, the request object is not yet created in either > web2py server or shell or worker (web2py.py -K milo) > Sorry, it should be request.global_settings.cmd_optio

[web2py] Re: web2py on appfog

2012-08-03 Thread spiffytech
Followup: I contacted AppFog support via their live chat to get a few questions answered: - Confirmed: You can't buy more storage (yet). It's a priority for them, though. - An app's instances don't all see the same copy of the filesystem. That's less of a problem than the fact that

[web2py] GAE Cloud SQL local dev server problem

2012-08-03 Thread Alexei Vinidiktov
Hello, I'm need hep figuring out how to set up a local GAE development server with MySQL. MySQL connection parameters are specified via App Launcher application settings: --mysql_user=root --mysql_password=xx --mysql_host=localhost --mysql_port=3306 When I launch my web2py app with GAE Launc