Re: [web2py] Two components + two forms

2012-12-02 Thread David Sorrentino
Ok Massimo, changing *formname* was the solution. Now everything works. Thanks one more time for your help. ;) I wish you a good Monday, David On 2 December 2012 09:00, David Sorrentino wrote: > Hello Massimo and thanks for your reply. > The two components point to a different action

Re: [web2py] Two components + two forms

2012-12-02 Thread David Sorrentino
Di Pierro wrote: > Do the two components point to the same action, or do they contain forms > with same formname? Either case that would not work because multiple forms > in the same page must have different formnames? > > > On Saturday, 1 December 2012 13:32:48 UTC-6, David S

[web2py] Two components + two forms

2012-12-01 Thread David Sorrentino
Hello everybody, I'm struggling for a while with a problem. I have a page with two components. Each component contains a form. I embedded both the components with LOAD. Unfortunately when I submit one of the two forms, all the values are deleted and apparently there is no submission. If then I sub

Re: [web2py] Re: Choosing the PDF file's name with appreport PISA

2012-11-19 Thread David Sorrentino
. > > -Mandar > > > On Monday, November 19, 2012 2:24:07 PM UTC+5:30, Mandar Vaze wrote: >> >> Same here. I downloaded the w2p on Nov 12th - so I think I have the >> latest version. But the filename seems to be ignored. >> I'm using web2py 2.0.9 >&

Re: [web2py] Multilanguage website

2012-11-17 Thread David Sorrentino
g_lang = request.uri_lang > request.uri_lang = 'en' > this_page_in_eng_url = URL() > request.uri_lang = 'it' > this_page_in_it_url = URL() > request.uri_lang = orig_lang > return dict() > > > > > > > > > On Friday,

Re: [web2py] Multilanguage website

2012-11-16 Thread David Sorrentino
go to the "it" function in the same controller I'm in". > haven't played with that, but I guess web2py expects something like > /a/lang/c/f so, by some means of request.something > (function,controller,args,etc) you should be able to. > > > > O

Re: [web2py] Multilanguage website

2012-11-16 Thread David Sorrentino
eers, David On 16 November 2012 11:33, David Sorrentino wrote: > Hi Niphlod, > > Thanks for your example. It's crystal clear. ;) > I got another doubt about multi-languages: on the online book I read that > in order to tell web2py which language is the default one, I have

Re: [web2py] Multilanguage website

2012-11-16 Thread David Sorrentino
Hi Niphlod, Thanks for your example. It's crystal clear. ;) I got another doubt about multi-languages: on the online book I read that in order to tell web2py which language is the default one, I have to use: T.set_current_languages('it') > Now I am wondering if I need to use it in the controller

Re: [web2py] Multilanguage website

2012-11-15 Thread David Sorrentino
but if your website is > basically content (posts, manuals, etc) it may be a lot easier to maintain > a "default content" (file,db row, etc) and all the translations that, if > not found, fall back to the "default english" content page. > > > On Thursday, November

[web2py] Multilanguage website

2012-11-15 Thread David Sorrentino
Hi folks! :) I am here for asking you an opinion. Since I am developing a multilanguage website, I am wondering if there is a best practice for managing the translation of the content. I mean, now I added in my routers: > myapp = dict(languages=['en', 'it', 'pl'], default_language='en') > > so I

Re: [web2py] Re: Multi-language website with GAE + parameter-based system

2012-11-15 Thread David Sorrentino
02:42, howesc wrote: > the error is not obvious to me. :( can you verify that your regex matches > your URL? > > > On Tuesday, November 13, 2012 6:01:09 AM UTC-8, David Sorrentino wrote: > >> Hi howesc, >> >> Thanks for your reply! >> >> I tried t

Re: [web2py] Re: web2py as Windows service

2012-11-14 Thread David Sorrentino
11:52:36 UTC+1, David Sorrentino ha > scritto: > >> Ok, I managed to make it work. >> I set the *ip* variable to '127.0.0.1'. >> >> So, the ActivePython environment made the trick. >> Thank you very much for your help Tim. ;) >> >> Di

Re: [web2py] request args

2012-11-14 Thread David Sorrentino
Hello Paul, request.args[0] returns a string, and for *Rows = db(db.bike.id==tag_no).select() *you need an integer. Try this: tag_no = int(request.args(0)) > And let me know. Cheers, David On 14 November 2012 00:28, Paul Rykiel wrote: > Hi just learning WEB2py and I have a question: > > why

Re: [web2py] Re: web2py as Windows service

2012-11-14 Thread David Sorrentino
Thanks to Niphlod, too. I hadn't seen your post! ;) Cheers, David On 14 November 2012 11:52, David Sorrentino wrote: > Ok, I managed to make it work. > I set the *ip* variable to '127.0.0.1'. > > So, the ActivePython environment made the trick. > Thank y

Re: [web2py] Re: web2py as Windows service

2012-11-14 Thread David Sorrentino
use in that way I don't need to install Python before installing my app. Cheers, David On 14 November 2012 11:07, David Sorrentino wrote: > I just tried with ActivePython 2.7 and it works. I mean, at least the task > manager says that the service is running. :) > However I do n

Re: [web2py] Re: web2py as Windows service

2012-11-14 Thread David Sorrentino
he windows boxes, and > therefore with a source installation of web2py. > > My practical advice is go for this set up and see if that fixes the > problem. You get a considerably different Python distribution this way. > > regards > > Tim > > > > On Wednesday, 14 N

Re: [web2py] Re: web2py as Windows service

2012-11-13 Thread David Sorrentino
Hello Derek and Tim, First of all thanks for your reply. :) @Derek: I do not see any log in the logs folder, but logging is not enabled. This morning I will enable it and tell you the results. @Tim: I am testing my app on Windows 7. I did not install any Python distribution on Windows, since I h

Re: [web2py] Re: Multi-language website with GAE + parameter-based system

2012-11-13 Thread David Sorrentino
eet > your needs): > > - url: /(?P.+?)/static/.*?/(?P.+) > static_files: applications/\1/static/\2 > upload: applications/(.+?)/static/(.+) > secure: optional > expiration: "1d" > > cfh > > > On Monday, November 12, 2012 7:19:32 AM UTC-8, David So

Re: [web2py] salary survey info

2012-11-12 Thread David Sorrentino
+1 ;) On 12 November 2012 16:41, Massimo Di Pierro wrote: > > http://www.infoworld.com/t/it-jobs/2013-it-salaries-15-titles-getting-the-biggest-pay-raises-206630?source=IFWNLE_nlt_wrapup_2012-11-10 > > -- > > > > --

[web2py] Multi-language website with GAE + parameter-based system

2012-11-12 Thread David Sorrentino
Hello everybody! :) I am developing a multi-language website deployed on GAE. For my routes.py I would like to use this configuration, shown on the online book ( http://web2py.com/books/default/chapter/29/04#Parameter-based-system): routers = dict( BASE = dict(default_application='myapp'),

[web2py] web2py as Windows service

2012-11-12 Thread David Sorrentino
Hello folks! :) I am trying to run web2py as Windows service, but no positive results. Following the recipe on the online book, I edited the file "options.py". The file looks like that: #!/usr/bin/python # -*- coding: utf-8 -*- import socket import os ip = 127.0.0.1 port = 8000 interfaces = [('1

[web2py] Choosing the PDF file's name with appreport PISA

2012-11-11 Thread David Sorrentino
Hello everybody! :) I am using appreport with the PISA engine in order to export a view to a PDF file and I would like to choose the name of the PDF file generated. The view is the following one: results = dict(success=True) html = response.render('default/results.html', results) return plugin_ap

Re: [web2py] Plugin installation without admin

2012-11-10 Thread David Sorrentino
Easier than expected! :) Thank you Massimo. I wish you a good Sunday. David On 11 November 2012 01:15, Massimo Di Pierro wrote: > cd applications/yourapp > tar zxvf /path/to/web2py.plugin.name.w2p > > > On Saturday, 10 November 2012 16:34:21 UTC-6, David Sorrentino wro

[web2py] Plugin installation without admin

2012-11-10 Thread David Sorrentino
Hello everybody, I am wondering if there is a way to install a plugin without using the admin interface. Can anybody help me in that? Cheers, David --

Re: [web2py] Re: How to make a dropdown optional?

2012-11-06 Thread David Sorrentino
gt; How about > > IS_EMPTY_OR(IS_IN_**SET(,zero='')) > > > On Tuesday, 6 November 2012 08:31:49 UTC-6, David Sorrentino wrote: > >> Hi Massimo, and thank you for your reply. :) >> >> I had already tried requires=IS_EMPTY_OR(IS_IN_**SET()) and it

Re: [web2py] Re: How to make a dropdown optional?

2012-11-06 Thread David Sorrentino
wrote: > requires=IS_EMPTY_OR(IS_IN_SET()) > > > On Tuesday, 6 November 2012 06:46:24 UTC-6, David Sorrentino wrote: >> >> Hey there! :) >> >> Other day, other doubt. :P >> >> In my controller I define a form with SQLFORM.factory. This form con

[web2py] How to make a dropdown optional?

2012-11-06 Thread David Sorrentino
Hey there! :) Other day, other doubt. :P In my controller I define a form with SQLFORM.factory. This form contains a dropdown. Here is the code. def mansioni(): form = SQLFORM.factory( Field('just_a_dropdown', requires=IS_IN_SET({'first_choice': 'First choice', 'second_choice': 'Sec

Re: [web2py] Re: Problems with LOAD and redirect(..., type='auto')

2012-11-05 Thread David Sorrentino
Thanks a lot Leonel! It works. ;) Wish you a good day, David On 5 November 2012 15:27, Leonel Câmara wrote: > I believe what you want is now: > > client_side=True > > > as an argument to the redirect, instead of the type='auto' > > The book seems to be outdated in that part. > > -- > > > > --

[web2py] Problems with LOAD and redirect(..., type='auto')

2012-11-05 Thread David Sorrentino
Hello everybody, :) In practice, I have a page (default/calculate.html) which in turn loads another page (forms/mansioni.load) by means of LOAD. Here the code of the page* default/calculate.html*: {{=LOAD('forms', 'mansioni.load', ajax=True)}} The page *forms/mansioni.load* contains just

Re: [web2py] routes.py and anchor links

2012-10-23 Thread David Sorrentino
wrote: > On 22 Oct 2012, at 9:28 AM, David Sorrentino > wrote: > > I have got some doubts about the use of anchor links and the URL > rewriting by means of routes.py. > > > > This is my routes.py: > > > > routes_out = ( > > ('/myapp/default/$f&

[web2py] routes.py and anchor links

2012-10-22 Thread David Sorrentino
Hey there! :) I have got some doubts about the use of anchor links and the URL rewriting by means of *routes.py*. This is my *routes.py*: routes_out = ( > ('/myapp/default/$f', '/$f') > ) > So* **/myapp/default/just_a_page* is rewritten in output like */just_a_page*. This works. The proble

Re: [web2py] ondelete and onaccept

2012-10-15 Thread David Sorrentino
Thanks Alan, This works fine. I just misunderstood the book. ;) Have a good day, David On 15 October 2012 01:47, Alan Etkin wrote: > For me the behavior is the expected (because the form was accepted and the > record deleted). Perhaps you can avoid executing onaccept inside the > handler like

[web2py] ondelete and onaccept

2012-10-13 Thread David Sorrentino
Hi there, Maybe I just misunderstood the online book, but I would like to solve my doubts about this: In chaper #07, speaking about the CRUD method *ondelete*, the book says: ondelete is called in place of onaccept when a record is deleted via an > "update" form. > I added both to my *crud.updat

Re: [web2py] Issues with GAE?

2012-10-13 Thread David Sorrentino
using the custom importer for every import thus creating > problems. > > > On Saturday, 13 October 2012 09:12:26 UTC-5, David Sorrentino wrote: >> >> Hello everybody! ;) >> >> I updated web2py to the last stable version and now I'm getting this >> e

[web2py] Issues with GAE?

2012-10-13 Thread David Sorrentino
Hello everybody! ;) I updated web2py to the last stable version and now I'm getting this error: ERROR2012-10-13 14:06:26,000 wsgi.py:219] > Traceback (most recent call last): > File "/home/dapids/google_appengine/google/appengine/runtime/wsgi.py", > line 208, in Handle > for chunk in re

Re: [web2py] Re: Prettydate and time zones

2012-10-12 Thread David Sorrentino
It works like a charm. :) Thanks a lot for your help guys. I would have never figured it out by myself! Have a wonderful Friday! David On 12 October 2012 00:34, Niphlod wrote: > you're overridding the default validator (IS_DATE*) with IS_NOT_EMPTY > > replacing this line > db.news.date_lo

Re: [web2py] Re: Prettydate and time zones

2012-10-11 Thread David Sorrentino
r: unsupported operand type(s) for -: 'str' and > 'datetime.timedelta' > Just tell me if I have to provide other information about the issue. Thanks a lot. :) Best, David On 11 October 2012 22:44, Massimo Di Pierro wrote: > We need to see some of the code. Someh

Re: [web2py] Re: Prettydate and time zones

2012-10-11 Thread David Sorrentino
or that > maps request.vars.date into form.vars.date and performs the conversion. > > > On Thursday, 11 October 2012 06:30:46 UTC-5, David Sorrentino wrote: > >> Changed the name of the field from "date" to "created_on" to avoid >> confusion. >> Tried w

Re: [web2py] Re: Prettydate and time zones

2012-10-11 Thread David Sorrentino
ll for problems ... > > On Thursday, October 11, 2012 11:27:52 AM UTC+2, David Sorrentino wrote: > >> Thanks for your explanation Niphlod. ;) >> >> I'm trying to normalize the time, as you suggested. >> However I'm facing some difficulties. >> >&g

Re: [web2py] Re: Prettydate and time zones

2012-10-11 Thread David Sorrentino
need to take into > > consideration if you're working with user-inputted datetimes. You'd need > to > > retrieve it's local date (javascript comes to the rescue, or based on > > nation, or whatever) and calculate the difference between that and your > >

Re: [web2py] Re: Prettydate and time zones

2012-10-10 Thread David Sorrentino
s's browser one. > > In a "perfect" setup, your server is on GMT (that is, utc), your app uses > request.utcnow in all the places instead of request.now (and > datetime.datetime.utcnow() instead of datetime.datetime.utcnow()). You'll > have prettydate working rig

Re: [web2py] Re: Prettydate and time zones

2012-10-10 Thread David Sorrentino
ctober 10, 2012 10:16:24 AM UTC+2, David Sorrentino wrote: >> >> Hello everybody, >> >> I am using the module *prettydate*, but it seems that it matches the >> datetime I give as input with a wrong timezone. >> >> For example now it's 10:12 am at my place

[web2py] Prettydate and time zones

2012-10-10 Thread David Sorrentino
Hello everybody, I am using the module *prettydate*, but it seems that it matches the datetime I give as input with a wrong timezone. For example now it's 10:12 am at my place. This is the datetime I give as input: 2012-10-10 10:12:00. This is the code: from gluon.tools import prettydate > pre

Re: [web2py] Re: SQLFORM.grid + GAE

2012-10-02 Thread David Sorrentino
Fixed in trunk. Thanks Massimo! Cheers, David On 2 October 2012 04:48, Massimo Di Pierro wrote: > I believe this is fixed in trunk. Can you help test it? > > > On Sunday, 30 September 2012 13:08:10 UTC-5, David Sorrentino wrote: > >> Sure I can! ;) >> >> Here

Re: [web2py] Adding cancel button - form submission

2012-10-01 Thread David Sorrentino
wrote: > When you add_button('cancel',) you do not get a form.custom.cancel. > Sorry. > > > On Monday, 1 October 2012 13:36:02 UTC-5, David Sorrentino wrote: >> >> Hi everybody, >> >> Sorry for re-opening this thread, but I'm trying without succ

Re: [web2py] Adding cancel button - form submission

2012-10-01 Thread David Sorrentino
Hi everybody, Sorry for re-opening this thread, but I'm trying without success to add a cancel button to a CRUD form. Here my controller: def insertnews(): form = crud.create(db.news) form.add_button("cancel",URL(r=request,f='index')) return dict(form=form) Here my view: {{=form.cus

Re: [web2py] Re: SQLFORM.grid + GAE

2012-09-30 Thread David Sorrentino
ECIAL_PROPERTY, value, typename(value))) > BadFilterError: invalid filter: __key__ filter value must be a Key; > received None (a NoneType). > Thanks for your help Massimo. Cheers, David On 30 September 2012 19:40, Massimo Di Pierro wrote: > Can you please post the entire tracebac

[web2py] SQLFORM.grid + GAE

2012-09-30 Thread David Sorrentino
Hi there! :) I'm trying to exploit the power of SQLFORM.grid with GAE but I'm having some troubles. All I want to do is to have a grid from a table (seems to be simple reading the infinite examples on the web). Here my table definition: db.define_table('news', > Field('title'), > Field('

Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine

2012-09-19 Thread David Sorrentino
2.7 and the sdk > with 2.5. I suspect when 2.5 finds the pyc created with 2.7 it complains. > GAE does not complain because the pyc are not deployed. Try delete all the > pyc files, restart the SDK and it should not complain. > > > On Tuesday, 18 September 2012 14:10:52 UTC-5, D

Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine

2012-09-18 Thread David Sorrentino
rrors with the SDK or GAE or both? Are most >> of the errors for pyc files or files in plural_rules? does it look they are >> always the same files? >> >> On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: >> >>> Apparently it is. >>&

Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine

2012-09-18 Thread David Sorrentino
ways the same files? > > On Tuesday, 18 September 2012 11:08:44 UTC-5, David Sorrentino wrote: > >> Apparently it is. >> Just tried with python 2.5 and it seems to work. >> I just get an avalanche of warnings every time a load a page. >> >> Here an instance: >

Re: [web2py] Re: Presentations + IOError: [Errno 13] with google appengine

2012-09-18 Thread David Sorrentino
12 04:20:16 UTC-5, David Sorrentino wrote: >> >> Hi everybody! >> >> My name is David and I started "playing" with web2py few days ago. My >> first impression is definitely positive and I hope to start soon >> contributing to this wonderful community!

[web2py] Presentations + IOError: [Errno 13] with google appengine

2012-09-18 Thread David Sorrentino
Hi everybody! My name is David and I started "playing" with web2py few days ago. My first impression is definitely positive and I hope to start soon contributing to this wonderful community! Yesterday I built my first app and deployed it with nginx. Works like a charm! :D So, today I wanted to tr

Re: [web2py] Re: How to login to Web2Py-app by providing username and password in URL?

2012-09-12 Thread David Sorrentino
> > Security is clearly not at the top of your agenda :) > LoL On 12 September 2012 14:09, villas wrote: > Security is clearly not at the top of your agenda :) > Something like this might work: > > def logmein(): > # minimal, insecure login function > auth.login_bare(request.vars['user

Re: [web2py] Pynes notify

2012-09-12 Thread David Sorrentino
Impressive. On 12 September 2012 08:40, Bruno Rocha wrote: > This plugin for Bootstrap looks very nice for response.flash > > http://pinesframework.org/pnotify/ > > > -- > > > > --