[web2py] Re: testing scheduler in windows

2011-09-02 Thread Massimo Di Pierro
we have yet another scheduler in trunk, based on the tests performed in this thread. the new scheduler is still imperfect but - supports the same syntax as before (although tables are a little different) - should run on windows (needs testing) - does not require defining any module (only instantiat

[web2py] Re: comparing datetime objects in db query fails

2011-09-02 Thread nick name
Two patches that solve this in different ways (both against trunk, but would probably apply cleanly to any recent version): 1 - patch to welcome application diff -r 1462bcd5ea7a applications/welcome/models/db.py --- a/applications/welcome/models/db.pyFri Sep 02 20:41:54 2011 -0500 +++ b/appl

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread Massimo Di Pierro
My problem was this? value = " '\' " connection = psycopg2.Connect() cursor = connection.cursor() curser.execute('set normal_conformal_string=on;") cursor.execute("INSERT INTO TABLE(FIELD) VALUES(%s);",value) #1 curser.execute('set normal_conformal_string=off;") cursor.execute("INSERT INTO TA

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread nick name
psycopg uses a Postgres provided routine to escape the strings, which is aware of what version of postgres is at the other end of the connection (apparently since library shipped with 8.1.4, if I can read the source correctly): Link to relevant psycopg file is here

[web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Massimo Di Pierro
Good catch. Can you check trunk? On Sep 2, 7:02 pm, Jonathan Lundell wrote: > On Sep 2, 2011, at 3:45 PM, Stefaan Himpe wrote: > > >> Is this coming through generic.json? > > > I created a simple web application from scratch, only added this code in > > the controller (I think web2py has support

[web2py] Re: password widget, validators and ending up with asterisks

2011-09-02 Thread Massimo Di Pierro
Field('name',type='password') makes use data can only go in but never out to forms. On Sep 2, 5:29 pm, Aaron Mahler wrote: >  I'm definitely using web2py's login functionality for the app itself, > yes... but this particular password field I'm describing isn't related > to logging into web2py, se

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread Massimo Di Pierro
Thanks for the confirmation. I still do not understand fully how psycopg2 knows whether one has set standard_conforming_string to on or off. I asked the psycog2 list but I have not got a reply yet. Massimo On Sep 2, 3:35 pm, Kurt Grutzmacher wrote: > Hi Massimo, > > I updated to the the latest t

[web2py] Re: displaying a computed field

2011-09-02 Thread Massimo Di Pierro
Yes the book refers to manual insert/update. On Sep 2, 3:25 pm, paroiron wrote: > > Maybe that is referring to doing a manual insert or update (via .insert() or > > .update(), not via a form submission). > > > Anthony > > I'll try it.

Re: [web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
On Sep 2, 2011, at 3:45 PM, Stefaan Himpe wrote: >> Is this coming through generic.json? > > I created a simple web application from scratch, only added this code in the > controller (I think web2py has support for both json and jsonrpc? i'm using > jsonrpc here): It looks to me as if Service.

[web2py] Re: Web2py in a pure python data acquisition system

2011-09-02 Thread mikech
Impressive!

[web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Stefaan Himpe
Is this coming through generic.json? I created a simple web application from scratch, only added this code in the controller (I think web2py has support for both json and jsonrpc? i'm using jsonrpc here): @service.jsonrpc def add(x,y): return x+y Now, I post a json request over http to

[web2py] OFF Topic - http://jsfiddle.net

2011-09-02 Thread António Ramos
Interesting http://jsfiddle.net/zalun/FZqZN/

[web2py] Re: password widget, validators and ending up with asterisks

2011-09-02 Thread Aaron Mahler
I'm definitely using web2py's login functionality for the app itself, yes... but this particular password field I'm describing isn't related to logging into web2py, sessions, etc. This is an interface to an LDAP server where user account entries are being edited. The password field is part of tha

Re: [web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
Is this coming through generic.json? On Sep 2, 2011, at 2:15 PM, Stefaan Himpe wrote: > >> There *is* a bug, but it should be generating text/x-json (and that should >> be fixed). Are you sure you're getting text/html? > > I definitely received text/html. > (web2py 1.98.2, running on rocket 1

[web2py] Re: content type of jsonrpc service reply

2011-09-02 Thread Stefaan Himpe
There *is* a bug, but it should be generating text/x-json (and that should be fixed). Are you sure you're getting text/html? I definitely received text/html. (web2py 1.98.2, running on rocket 1.2.2). A wide variety of content types seems to be in use, but http://www.ietf.org/rfc/rfc4627.txt

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread Kurt Grutzmacher
Hi Massimo, I updated to the the latest trunk and my imports no longer have the problem in Issue #403. I swear nick and I didn't collude to report similar issues! :) On another system running web2py 1.98.2 (2011-08-31 20:40:46) and postgresql 8.4 I do not receive the same error. With the same

Re: [web2py] content type of jsonrpc service reply

2011-09-02 Thread Jonathan Lundell
On Sep 2, 2011, at 1:01 PM, Stefaan Himpe wrote: > I seem to have hit an unexpected detail of the jsonrpc support in web2py: > when I post a json request to my web2py application, I get a json reply with > a content-type set to "text/html; charset=utf8" (whereas i had expected > something like

[web2py] Re: displaying a computed field

2011-09-02 Thread paroiron
> > Maybe that is referring to doing a manual insert or update (via .insert() or > .update(), not via a form submission). > > Anthony I'll try it.

[web2py] Re: Priorities for web2py applications?

2011-09-02 Thread Michael Ellis
When things get murky, WinPDB http://winpdb.org/ is your best friend. Despite the unfortunate name, it has nothing to do with Windows. It's a free thread and fork aware python debugger. You can learn an amazing amount about what's going on under the hood in a very short time. Cheers, Mike On S

[web2py] content type of jsonrpc service reply

2011-09-02 Thread Stefaan Himpe
Hello, I seem to have hit an unexpected detail of the jsonrpc support in web2py: when I post a json request to my web2py application, I get a json reply with a content-type set to "text/html; charset=utf8" (whereas i had expected something like "application/json"). Am I doing something wrong

[web2py] Web2py in a pure python data acquisition system

2011-09-02 Thread Michael Ellis
For the past couple of months, I've been developing a data acquisition product for a client. It's turning out very well. I can't share the code, alas, but I can share the design approach and speak, in particular, to the way Web2py has turned out to be a huge asset. This is a 100% pure python s

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread Massimo Di Pierro
No that is ok. Thanks! On Sep 2, 2:12 pm, Carlos wrote: > Hi Massimo, > > I'm using postgresql 9.0 on win7 with the latest web2py trunk, up to > changeset [ (5ac67457363f) fixed pgsql problem, getquoted ]. > > I executed the 3 lines of code in shell (using 'xx' for table name instead > of the in

[web2py] Re: broken DAL with changeset # (d637c1e36408) possible fix to lack of conformality in PGSQL

2011-09-02 Thread Carlos
I just responded to the other topic, thanks.

[web2py] Re: On storing datetime in the database, and textual representation of fields

2011-09-02 Thread Carlos
Hi Massimo, I'm using postgresql 9.0 on win7 with the latest web2py trunk, up to changeset [ (5ac67457363f) fixed pgsql problem, getquoted ]. I executed the 3 lines of code in shell (using 'xx' for table name instead of the invalid 'x'), and so far no errors, with " '\' " inserted into the y f

[web2py] Re: broken DAL with changeset # (d637c1e36408) possible fix to lack of conformality in PGSQL

2011-09-02 Thread Massimo Di Pierro
Thanks for reposting this. Now fixed in trunk. Any chance you can help me run the tests: http://groups.google.com/group/web2py/msg/ae7816407ab3c1ba for the older version and the newer version? On Sep 2, 1:30 pm, Carlos wrote: > Hi, > > DAL is broken for postgresql (9.0 on win7) immediately afte

[web2py] broken DAL with changeset # (d637c1e36408) possible fix to lack of conformality in PGSQL

2011-09-02 Thread Carlos
Hi, DAL is broken for postgresql (9.0 on win7) immediately after applying the following changeset: # (d637c1e36408) possible fix to lack of conformality in PGSQL Error at insert: sequence item 1: expected string, psycopg2._psycopg.QuotedString found Traceback: File "C:\web2py\gluon\d

[web2py] Re: adopt an app!

2011-09-02 Thread Massimo Di Pierro
done. thank you. On Sep 2, 10:30 am, Ivica Kralj wrote: > Hi Massimo, > > Here is the link   -http://code.google.com/p/web2py-appointment-manager/. > > As my contribution was so small, 3-4 lines of code , I don't feel > comfortable to list other people work as my own :). > > If anybody else is in

[web2py] Re: "function ... is not JSON serializable" error when rendering db row as JSON

2011-09-02 Thread Amnon Khen
Sorry for the noise. I am such a noob :) I posted a wrong link to thepost about "islambda" function. The correct one is: http://kbyanc.blogspot.com/2007/05/python-islambda.html Amnon On Sep 2, 7:12 pm, Amnon Khen wrote: > Hi, > As a quick workaround, I thought of modifying serializers.custom_j

[web2py] Re: "function ... is not JSON serializable" error when rendering db row as JSON

2011-09-02 Thread Amnon Khen
Hi, As a quick workaround, I thought of modifying serializers.custom_json in the following manner: 1. check whether the item is a lambda expression 2. if so, return its string representation (using repr()) I used a nice "islambda" function I found in http://bytes.com/topic/python/answers/39908-wha

[web2py] "function ... is not JSON serializable" error when rendering db row as JSON

2011-09-02 Thread Amnon Khen
Dear web2py folks, I have a controller that fetches a record from the DB (I'm using GAE). def event(): id=request.args[0] myrow = db.event[id] return dict(myrow = myrow) What I try to render the result as JSON, I get the following error (trace starts from generic.json view)

Re: [web2py] Re: adopt an app!

2011-09-02 Thread Ivica Kralj
Hi Massimo, Here is the link - http://code.google.com/p/web2py-appointment-manager/. As my contribution was so small, 3-4 lines of code , I don't feel comfortable to list other people work as my own :). If anybody else is interested to contribute, I'll give you required permissions on project'

Re: [web2py] Re: New 'represent' syntax

2011-09-02 Thread Johann Spies
> Shouldn't it be IS_IN_DB(db, 'journal.id', ...) -- note 'journal.id' > rather than 'journal_id'? Also, your list:reference has to refer to a > referenced table. > > Well spotted! Thanks. That was my mistake. Regards Johann -- May grace and peace be yours in abundance through the full know

Re: [web2py] Re: New 'represent' syntax

2011-09-02 Thread Anthony
On Friday, September 2, 2011 10:47:42 AM UTC-4, spyker wrote: > > On 26 August 2011 17:07, Martín Mulone wrote: > >> To debug the problem, start passing one by one the fields: >> >> > The following models work: > > db.define_table('journal', > Field('title'), > Fiel

Re: [web2py] Re: New 'represent' syntax

2011-09-02 Thread Johann Spies
Sorry, > requires = IS_IN_DB('journal_id', 'title)%s', > zero = None) > must be requires = IS_IN_DB(db,'journal_id', '%(title)s', zero = None)), With the same result. Johann -- May grace and peace be yours in abundance through

[web2py] Re: displaying a computed field

2011-09-02 Thread Anthony
On Friday, September 2, 2011 3:07:07 AM UTC-4, paroiron wrote: > > Thank you, > I'll probably do the math in my app, because I'd like to be able to > perform a search on the result (impossible with virtual fields, am I > right?). > > However, I think the text in the book is misleading : > "[..

Re: [web2py] Re: New 'represent' syntax

2011-09-02 Thread Johann Spies
On 26 August 2011 17:07, Martín Mulone wrote: > To debug the problem, start passing one by one the fields: > > The following models work: db.define_table('journal', Field('title'), Field('issn'), Field('subject'), Field('heading'),

Re: [web2py] Priorities for web2py applications?

2011-09-02 Thread Jonathan Lundell
On Sep 1, 2011, at 11:57 PM, Henri Heinonen wrote: > 2011/9/1 Jonathan Lundell > If it's convenient, you might experiment with calling time.sleep(0) fairly > frequently in your CPU-bound simulation app, perhaps in some inner loop, to > yield to other threads. > > I tried time.sleep(0), but it

[web2py] Re: IS_IN_SET validator zero option

2011-09-02 Thread Eric
Thanks so much, Bruno. I also found this in the manual -- I had overlooked the fact that the zero option was available there. Appreciate that you took the time to answer. Eric On Sep 1, 8:39 pm, Bruno Rocha wrote: > > db.define_table('plan', >     Field

Re: [web2py] Re: testing scheduler in windows

2011-09-02 Thread António Ramos
Sorry i missed the link http://www.youtube.com/watch?v=Y8RRsEkPc_A Em 2 de setembro de 2011 14:30, António Ramos escreveu: > I´m exited about the scheduler because i need it a LOT! > > My opinion about the scheduler importance: > > I think i shoud be as important as view, controllers and models s

Re: [web2py] Re: testing scheduler in windows

2011-09-02 Thread António Ramos
I´m exited about the scheduler because i need it a LOT! My opinion about the scheduler importance: I think i shoud be as important as view, controllers and models so why not include it in the design of the app Models Controllers Views *Tasks* ? Please see a video of how tasks are created in Lot

[web2py] Re: Has anyone heard of OrientDB? +1 more question

2011-09-02 Thread Massimo Di Pierro
I am interested but this will be postponed a little bit. Please open an issue so we will remember. On Sep 2, 1:31 am, David Marko wrote: > Let me know of your progress on OrientDB integration. I can help with > testing ...

[web2py] Re: How to run a script in Eclipse

2011-09-02 Thread JanoPales
I do it this way: -right click on 'web2py.py' -there is 'Run As' or 'Debug As' -choose 'Python Run' You can set arguments in 'Run Configuration' (below Python Run). Python interpreter must be set of course Jano

[web2py] Re: displaying a computed field

2011-09-02 Thread paroiron
Thank you, I'll probably do the math in my app, because I'd like to be able to perform a search on the result (impossible with virtual fields, am I right?). However, I think the text in the book is misleading : "[...]if a value for the field is not provided, web2py tries to compute from the other

Re: [web2py] R: Upload & Install packed application on FluxFlex - Error500

2011-09-02 Thread Yota Ichino
Foresto, The issue is caused by server's setting. The server limits POST size. Don't worry, "POST limit" issue is under consideration by fluxflex. 2011/9/1 Valter Foresto : > I just try again to Upload a packed web2py application on FluxFlex but I get > the same Error500 of a week ago. > Can anyb