Re: [web2py] Re: Some powerTable questions

2011-09-01 Thread Bruno Rocha
On Thu, Sep 1, 2011 at 2:26 AM, Roberto Perdomo roberto...@gmail.comwrote: Bruno, please add #refreshLabel = 'Refresh' to you example of powergrid, or the best solution: why not use T('label') as example self.attributes['refreshLabel'] = T('Refresh') in powergrid.py for translate support?

[web2py] [OFF] New Janrain Engage Social Login Widgets

2011-09-01 Thread Bruno Rocha
Janrain has new widgets ** Dear Janrain Customer, I have some exciting news to share. We have been hard at work for the past several months building the next generation Janrain Engage social login widget and are happy to announce that after several weeks of closed beta, we will be rolling

[web2py] Select by id off by one error

2011-09-01 Thread Joe Barnhart
I've become addicted to shortcuts, and I'm surprised to get an off by one error when using my favorite: db().select(db.table.ALL)[id] where id is the row you want to retrieve. In my case, the row data is for the id+1 row, not the id row. I'm using the latest released version (1.98.2) on Mac

[web2py] Re: auth_user fields writable/readable False

2011-09-01 Thread annet
@Bruno, are you creating the form object before or after this? You need to specify attributes before the creation of the form object. Thanks for your reply, you were right, I had to put the lines of code before form= This works: def user(): if request.args(0)=='profile':

[web2py] Select by id off by one error

2011-09-01 Thread pbreit
Not equivalent. The square brackets are specifying the id'th item in the result set (which begins counting at 0). Here's a better shortcut for grabbing one record: row = db.table(id)

[web2py] Re: Select by id off by one error

2011-09-01 Thread Joe Barnhart
You are correct in that your explanation describes exactly how web2py currently works. But the online manual (and all previous editions) have shown the two methods to be equivalent. It's the first example in the shortcuts section of the Database Abstraction Layer chapter...

Re: [web2py] Select by id off by one error

2011-09-01 Thread Vasile Ermicioi
dear Joe rows = db().select(db.table.ALL) is a list of records and rows[0] is first record, rows[1] is second ... as pbreit mentioned this works row = db.table(id) and this row = db.table[id]

Re: [web2py] Re: Select by id off by one error

2011-09-01 Thread Vasile Ermicioi
the shortcut works on tables not on result sets or lists

[web2py] Re: Select by id off by one error

2011-09-01 Thread Joe Barnhart
Of course! You have hit it on the head. That is exactly my mistake. The book is correct, and the error is all mine. Warm regards, -- Joe On Sep 1, 1:42 am, Vasile Ermicioi elff...@gmail.com wrote: from the book myrecord = db.mytable[id] del db.mytable[id] db.mytable - is the table

[web2py] Re: Published my collection of plugins

2011-09-01 Thread kenji4569
Hi Richard, thank you for your feedback. It works great except that it seems to conflict with jQuery UI tabs and dialog... I fixed it (tested Chrome, FF, IE). See: http://dev.s-cubism.com/plugin_anytime_widget/test/with_jquery_ui (The anytime css should precede the jquery ui css) It no show up

[web2py] Re: Timeout limit for applications?

2011-09-01 Thread Henri Heinonen
Something like this, perhaps: i m a g e s h a c k . u s / f / 5 3 4 / s c r e e n s h o t i b . p n g / Henri. On Aug 31, 2:57 pm, Henri Heinonen henri.heino...@gmail.com wrote: Is it possible to set a timeout limit for applications that seem to run forever and forever?

[web2py] Re: Priorities for web2py applications?

2011-09-01 Thread Henri Heinonen
Something like this, perhaps: h t t p : / / i m a g e s h a c k . u s / f / 5 3 4 / s c r e e n s h o t i b . p n g / Henri. On Aug 31, 2:33 pm, Henri Heinonen henri.heino...@gmail.com wrote: Hi! Is it possible to set priorities for web2py applications? I am running a web2py server with

Re: [web2py] Re: Priorities for web2py applications?

2011-09-01 Thread Vasile Ermicioi
web2py is a framework, setting priorities seems more a job for a webserver

Re: [web2py] Re: Timeout limit for applications?

2011-09-01 Thread Vasile Ermicioi
same answer, what you try to achieve is a job for a webserver, the webserver is the one to execute applications using threads, processes or coroutines, and setting priorities and timeouts for threads, processes and coroutines is the job of the webserver

[web2py] displaying a computed field

2011-09-01 Thread Pierre-Antoine Roiron
Hi everyone, this is my first message on the googlegroup. In the web2py book, computed fileds are described with this explanation : When a new record is modified, including both insertions and updates, if a value for the field is not provided, web2py tries to compute from the other field values

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

2011-09-01 Thread 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 anybody have a solution or work-around suggestions for that issue ? Thanks. - Valter

Re: [web2py] Re: testing scheduler in windows

2011-09-01 Thread Brian M
Isn't that pretty much what we're supposed to be seeing? Every few heartbeats it recognizes a task that needs running, starts it and reports back when complete? C:\Users\Brian\Documents\development\web2py\google hg repopython trunk/gluon/me ta_scheduler.py thumnew task starting task task

[web2py] Re: displaying a computed field

2011-09-01 Thread paroiron
I add that inserting : db.article.prix_net.readable=True does not help displaying the field in the admin form.

Re: [web2py] Re: New Plugin: plugin_ckeditor

2011-09-01 Thread Ross Peoples
Are you trying to initialize the plugin in db.py? If so, then the problem is that db.py is being read before plugin_ckeditor.py (web2py loads models in alphabetical order). So what I usually do is make a tables.py model where I define my tables. You can initialize the plugin in this file, as it

Re: [web2py] Re: Published my collection of plugins

2011-09-01 Thread Richard Vézina
Great! It nice that you take care of feedback... Don't worry about IE ;-) For moving, I think it a most have feature since the actual datepicker has it... What has to be done to make it available? Maybe the actual datepicker could be of some help to figure out how to make it moves... Thank

Re: [web2py] To when a calendar widget

2011-09-01 Thread Richard Vézina
Let me think about that and figure out by where we should start... For now what I see is : - We should build a little app at first then we can latter transform it into a plugin app... - I have the model of agenda and calendar of the Android calendar db... I have to check if it is

Re: [web2py] Re: New Plugin: plugin_ckeditor

2011-09-01 Thread António Ramos
sorry to disturb but cant get it to work. now this error Traceback (most recent call last): File gluon/restricted.py, line 192, in restricted File D:/web2py198_2/web2py/applications/Demo1/models/table.py, line 83, in module File gluon/custom_import.py, line 276, in __call__ File

Re: [web2py] Priorities for web2py applications?

2011-09-01 Thread Jonathan Lundell
On Aug 31, 2011, at 4:33 AM, Henri Heinonen wrote: Is it possible to set priorities for web2py applications? I am running a web2py server with some simulation applications. When I run them, the welcome application works very sluggishly so it seems to a visitor of my web2py server that the

Re: [web2py] Re: New Plugin: plugin_ckeditor

2011-09-01 Thread Ross Peoples
You must be using Python 2.5. I think tomt was the first to report this problem. The problem is coming from this code: self.settings.table_upload = self.db.define_table(upload_name, Field('title', length=255), Field('filename', length=255),

[web2py] Re: Error messages for radio validation

2011-09-01 Thread Eric
Pardon me for resurrecting a dead thread, but can any of the participants elaborate on the solution to this issue? I'm trying to accomplish the same goal of eliminating identical repeated error messages under each radio button in an SQLform using the radio widget. I still want an error message

[web2py] Access other table

2011-09-01 Thread Christian
Hello everyone, given the case, I have these 2 tables: db.define_table('artist', Field('name')) db.define_table('album', Field('artist_id', db.artist), Field('name')) How would I add a field in the album table, (e.g. artist_name), that references

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

2011-09-01 Thread Luis Goncalves
Thanks for the solution. Sorry for the slow reply - I wanted to try it out, but haven't since I had already fixed the problem by explicitly converting from strings to datetimes, and moved on with my work. One question: Why isn't the use of PARSE_COLTYPES the default behavior? It seems

[web2py] Big problem -- no session_id without using Auth

2011-09-01 Thread Joe Barnhart
I have an application where I desperately need to track state while users navigate through the site. For a variety of reasons it is not appropriate to force them to sign up, so Auth is turned off. What I am finding is that the variable response.session_id takes on a unique value with every mouse

[web2py] IS_IN_SET validator zero option

2011-09-01 Thread hu5ndy hu5ndy
Is there any way to use the IS_IN_SET validator zero option with a db field that is tied to a lookup table? For example, if I have db.define_table('plan', Field('id','id'), Field('option',type='string',label=T('Subscription Options')),

[web2py] openid server

2011-09-01 Thread MB
How i can build my own openid server for my w2p app? thank you!!!

[web2py] IS_IN_DB -- follow-up/apology

2011-09-01 Thread hu5ndy hu5ndy
I see now that the zero option is available in the IS_IN_DB validator. Apologies to the group for missing that in the manual.

[web2py] Re: New Janrain Engage Social Login Widgets

2011-09-01 Thread Eric
Thanks for this. I'm glad to hear they're working on their loading time. I was set to use Janrain for an upcoming project but abandoned it in favor of rolling my own OpenID because the Janrain widget was so slow to load. Painfully slow. I'm interested in finding out if it's actually four-times

Re: [web2py] Access other table

2011-09-01 Thread Richard Vézina
Add this below your album model... db.album.artist_id.requires=IS_IN_DB(db,db.artist.id,'%(name)s') You will have a dropbox instead of a empty field for artist_id field of table album. Richard On Thu, Sep 1, 2011 at 1:19 PM, Christian hff...@googlemail.com wrote: Hello everyone, given the

[web2py] File renaming

2011-09-01 Thread TheSweetlink
Please tell me where in the source code I can find out how web2py renames files to prevent directory traversal attacks. I want to emulate upload field behaviour of renaming the file and saving it to uploads dir with a reference to it in a currently unsupported DB. Thank you -David

[web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread pbreit
As far as I know it should remain constant for the session. I added {{=response.session_id}} to the layout.html of a fresh welcome app and the id remained the same on all pages.

[web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Joe Barnhart
Update -- This problem is variable. After logging into the admin session, logging out, closing the browser, and then opening it again the website seems to add sessions for me even as an unauthenticated user. Even after opening up a different browser it continued to work. But when someone else

[web2py] Re: displaying a computed field

2011-09-01 Thread pbreit
Computed fields can't be edited because they are computed. Maybe just set a default: db.article.price_with_taxes.default = lambda r: r.price*(1+r.taxes)/100) I would typically not advise creating a field in the database that is simply a computation of another field. I would probably use a

Re: [web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Jonathan Lundell
On Sep 1, 2011, at 11:25 AM, Joe Barnhart wrote: Update -- This problem is variable. After logging into the admin session, logging out, closing the browser, and then opening it again the website seems to add sessions for me even as an unauthenticated user. Even after opening up a

[web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Joe Barnhart
I can believe this. I too have seen it behave perfectly if I have EVER been logged in to the app (or admin i/f) from a computer. But if I go to a computer where it has NEVER seen the admin i/f or logged in, the app fails to give me a consistent session id. It's very weird. On Sep 1, 11:29 am,

[web2py] Re: File renaming

2011-09-01 Thread pbreit
Is this it? http://code.google.com/p/web2py/source/browse/gluon/dal.py#5329

Re: [web2py] Access other table

2011-09-01 Thread Christian Hoffmann
Hi Richard, thanks for your quick reply. After adding that to my db.py i still get something like this as JSON reply {content: [{name: the album name, artist_id: 1, year: null, id: 1}]} So still no name for artist_id in JSON and not in default.html I tested something like this:

[web2py] Re: File renaming

2011-09-01 Thread TheSweetlink
Yes that is precisely what I was searching for. Thank you for your turbo reply pbreit. On Sep 1, 2:44 pm, pbreit pbreitenb...@gmail.com wrote: Is this it?http://code.google.com/p/web2py/source/browse/gluon/dal.py#5329

[web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Joe Barnhart
Cookies and session ids are a bit of black magic to me. I assume that web2py handles the setting of the session cookie with the associated session id when the page is rendered. But I have no idea if this is right or not. It certainly is acting as though web2py is being contacted without the

Re: [web2py] Access other table

2011-09-01 Thread Christian Hoffmann
class MyVirtualFields(object): def artist_name(self): artistName = db.artist(self.album.artist_id).name return artistName db.album.virtualfields.append(MyVirtualFields()) This did the trick… but is this considered good practice? 2011/9/1 Christian Hoffmann

Re: [web2py] Re: Big problem -- no session_id without using Auth

2011-09-01 Thread Jonathan Lundell
On Sep 1, 2011, at 11:49 AM, Joe Barnhart wrote: Cookies and session ids are a bit of black magic to me. I assume that web2py handles the setting of the session cookie with the associated session id when the page is rendered. But I have no idea if this is right or not. It certainly is

Re: [web2py] Access other table

2011-09-01 Thread Richard Vézina
I am not sure of me with JSON and represent, I don't see why it not works since this seems OK : db.album.artist_id.represent = lambda id: db.artist(id).name For the best pratice... I am not the ritgh guy... But at least I think that you could get in trouble with .append() if your DB get

Re: [web2py] Access other table

2011-09-01 Thread pbreit
Wouldn't it need to be something like: db.album.artist_id.represent = lambda r: db.artist(r.id).name

[web2py] Issue on 'The ajax Function' on web2py Version 1.98.2 - tested using WelcomeAPP

2011-09-01 Thread Valter Foresto
I checked, using the 'WelcomeAPP' on Version 1.98.2 of web2py, the first example of 'ajax' function as descrived on web2py book *'**The ajaxFunction', Chapter 10 *. The returned value is always None instead of the expected echo of the typed characters in the input field. Anybody experienced

Re: [web2py] Access other table

2011-09-01 Thread Christian Hoffmann
Hi, thanks for the replies. @pbreit: Tested that too, but same result, means: does not work @Richard: Thanks, will look at that links! Problem is, that I use @request.restful() which gives me the results Regards, Christian P.S.: A little bit off topic: When I send a gluon Set a json() I get

[web2py] JQuery 1.6.3 released (major security XSS fix )

2011-09-01 Thread Bruno Rocha
http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/

[web2py] Re: mssql connect

2011-09-01 Thread patrick moon
Brian: You're the man...said the right thing. I didn't know pyodbc did not ship with web2py. Download and dropped it in the same folder as web2py (don't know if this was mentioned in doc.) Works like a beauty. Thanks all again. On Aug 31, 7:36 pm, Brian M bmere...@gmail.com wrote: What

Re: [web2py] Access other table

2011-09-01 Thread Richard Vézina
There is noting in the book about restful, I only find a video talking about experimental API... What you try to do is maybe not well tested and buggy I don't know... Try with the @json decorator first you will have a idea if it comes from the json or the restful... Richard On Thu, Sep 1, 2011

[web2py] Re: mssql connect

2011-09-01 Thread Brian M
Glad you got it working! :)

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

2011-09-01 Thread nick name
If I understand correctly, Massimo was unaware of this option when he originally implemented the DAL for sqlite, and making it default now is not backward compatible.

[web2py] Re: Issue on 'The ajax Function' on web2py Version 1.98.2 - tested using WelcomeAPP

2011-09-01 Thread pbreit
Can you show us the relevant code?

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

2011-09-01 Thread Aaron Mahler
I'm curious if this is proper behavior and, if so, what is the proper way to deal with it. I've put in my own little error trap to prevent it, but I'm wondering if my whole approach is wrong. I have a form that includes both password and password verification (type the second time to match)

Re: [web2py] IS_IN_SET validator zero option

2011-09-01 Thread Bruno Rocha
db.define_table('plan', Field('id','id'), Field('option',type='string',label=T('Subscription Options')), format='%(option)s', migrate=settings.migrate) db.define_table('subscription',

[web2py] More fun with session_id

2011-09-01 Thread Joe Barnhart
I'm having my share of session issues these days. This hour, my problem is that the variable response.session_id does not seem to be set at the point the model files are executed. I am storing sessions in the database (sqlite) to help work around a problem that manifests as a new session_id for

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

2011-09-01 Thread nick name
I've just opened issue #404http://code.google.com/p/web2py/issues/detail?id=404: datetime gets downgraded to 1-sec resolution when inserting to database - example and full details there. And just 90 minutes before that, someone else submitted issue

[web2py] Re: More fun with session_id

2011-09-01 Thread pbreit
These seem like unexpected problems. I wonder if it might make sense to start over from scratch? And leave the session behavior in its default state. What does your code look for setting session_id in the table record?

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

2011-09-01 Thread pbreit
Is there a reason you aren't using web2py's login? If you want to customize the login page, you can do this in views/default/user.html: {{if request.args(0)=='login':}} h2Login/h2 div id=user_form {{=form.custom.begin}} plabel for=emailEmail/labelbr

Re: [web2py] More fun with session_id

2011-09-01 Thread Jonathan Lundell
On Sep 1, 2011, at 5:47 PM, Joe Barnhart wrote: I'm having my share of session issues these days. This hour, my problem is that the variable response.session_id does not seem to be set at the point the model files are executed. I am storing sessions in the database (sqlite) to help work

[web2py] Re: testing scheduler in windows

2011-09-01 Thread Massimo Di Pierro
More work on this is in progress. I hope to have a new scheduler ready in 1-2 days with more features. On Sep 1, 7:52 am, Brian M bmere...@gmail.com wrote: Isn't that pretty much what we're supposed to be seeing?  Every few heartbeats it recognizes a task that needs running, starts it and

[web2py] Re: Priorities for web2py applications?

2011-09-01 Thread Massimo Di Pierro
The web application should not run expensive tasks like simulations. It should queue them and execute them in background. We are working a new scheduler that will make this easier. There is no way for web2py to control priority of threads. In fact there is no way to prioritize threads. massimo

[web2py] Re: Error messages for radio validation

2011-09-01 Thread Massimo Di Pierro
If you have multiple {{=INTPUT(_name='')}} with the same name you want to set {{=INPUT(_name='',hideerror=True)}} for some of them. On Sep 1, 12:06 pm, Eric hu5...@gmail.com wrote: Pardon me for resurrecting a dead thread, but can any of the participants elaborate on the solution to

[web2py] Re: JQuery 1.6.3 released (major security XSS fix )

2011-09-01 Thread Massimo Di Pierro
it is in trunk On Sep 1, 4:08 pm, Bruno Rocha rochacbr...@gmail.com wrote: http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/

[web2py] Re: adopt an app!

2011-09-01 Thread Massimo Di Pierro
can you host it on google code and I will simply link it? Make sure you list yourself as author. On Sep 1, 4:17 pm, Ivica Kralj ivicakr...@gmail.com wrote: Not sure if somebody already addopted this app, but enclosed you will find new version for appointment_manager app

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

2011-09-01 Thread Massimo Di Pierro
Want to try send me a patch? On Sep 1, 6:27 pm, nick name i.like.privacy@gmail.com wrote: If I understand correctly, Massimo was unaware of this option when he originally implemented the DAL for sqlite, and making it default now is not backward compatible.

[web2py] Re: Issue on 'The ajax Function' on web2py Version 1.98.2 - tested using WelcomeAPP

2011-09-01 Thread Massimo Di Pierro
Did you check the online book. there may be a typo in the printed book. On Sep 1, 3:27 pm, Valter Foresto valter.fore...@gmail.com wrote: I checked, using the 'WelcomeAPP' on Version 1.98.2 of web2py, the first example of 'ajax' function as descrived on web2py book *'**The ajaxFunction',

[web2py] Laboratory and Health System with HL7

2011-09-01 Thread Alfonso de la Guarda
Hello, Coordinating with the foundation come BIKA (http://www.bikalabs.com/) to carry BIKA web2py Labs, in fact for the next week my company will get a test concept. We will make some references provided by the project http://code.google.com/p/web2pyhl7/ Massimo, and add a new interface in a

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

2011-09-01 Thread Massimo Di Pierro
To follow up the discussion on the issue... At some point a choice was made in web2py whether the role of escaping of strings relies in web2py or in the database driver. We decided this was a job for web2py because we would have more control over it. This allows the code to be simpler and allows

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

2011-09-01 Thread Massimo Di Pierro
P.S. Nick, I want to clarify that you bringing this up is very important for us and I really appreciate. Security is a priority so if this turns out to be a different issue than the one I suspect we will fix it promptly. Even if this is not a new issue and it is the problem I suspect, we should

[web2py] Re: Laboratory and Health System with HL7

2011-09-01 Thread Alfonso de la Guarda
(Sorry for the horrible redaction of my previous mail) My company has coordinated with the BIKA foundation (http://www.bikalabs.com/) port BIKA Labs to web2py, in fact for the next week we will get a proof of concept. We will take some references provided by the project

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

2011-09-01 Thread Massimo Di Pierro
Looks like Nick is on 9.0.1 and pgsql is ignoring SET standard_conforming_strings=on; Has anybody seen this behavior before? If you are on postgresql and want to help with this security issue please try from web2py shell python web2py.py -S welcome -N db=DAL('postgresql://')