[web2py] Re: webserver slow, misreported

2010-03-26 Thread Michael Toomim
Actually it's handling about 5 requests per second, so there is def some concurrency. On Mar 26, 10:06 pm, Michael Toomim wrote: > I'm using web2py+rocket to serve jobs on mechanical turk. The server > probably gets a hit per second or so by workers on mechanical turk > using it. > > When I have

[web2py] webserver slow, misreported

2010-03-26 Thread Michael Toomim
I'm using web2py+rocket to serve jobs on mechanical turk. The server probably gets a hit per second or so by workers on mechanical turk using it. When I have no users, everything is fast. But in active use, I notice that web pages often load reay slow in my web browser, but the httpserver.log

[web2py] Re: gaema

2010-03-26 Thread Pepe
oh yes, that would be great! On Mar 21, 11:41 pm, mdipierro wrote: > Perhaps we could simplify some code and include this in auth. > > http://code.google.com/p/gaema/ -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send

[web2py] Re: Passing values to widgets

2010-03-26 Thread mdipierro
in the controller you can do db.table.field.widget = SomeWidgetConstructor(args) Not sure if this is what you are asking. On 26 Mar, 18:26, Avik Basu wrote: > Is there a way to pass arguments to a field's widget from the > controller?  For example: > > db.define_table("food", Field("name", "str

[web2py] Re: Query by list of ids on GAE

2010-03-26 Thread mdipierro
Not through the dal but if you find out how to do it using GAE API, post an example here and we can look into implementing it. Massimo On 26 Mar, 18:31, Dane wrote: > Can this be done through the DAL? I see there is a get() method on > google.appengine.ext.db that can take multiple keys, but tha

[web2py] Re: Passing values to widgets

2010-03-26 Thread DenesL
It depends on what specifically you are trying to accomplish. You could set the validator instead, for example: rr=db(db.food.name.like('m%')).select() db.ate.food_id.requires=IS_IN_SET([(r.id,r.name) for r in rr]) Denes On Mar 26, 6:26 pm, Avik Basu wrote: > Is there a way to pass argument

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
On Mar 26, 4:53 pm, mdipierro wrote: > I a not sure. I know I tried once and it did not work (firefox). It did work for me with Firefox 3.6.2 on Win. > I could not find specs anywhere about this. Can anybody expand our limited knowledge on the subject?. Or propose alternative methods?. I will

[web2py] Query by list of ids on GAE

2010-03-26 Thread Dane
Can this be done through the DAL? I see there is a get() method on google.appengine.ext.db that can take multiple keys, but that syntax confuses me. -Dane -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web.

[web2py] Passing values to widgets

2010-03-26 Thread Avik Basu
Is there a way to pass arguments to a field's widget from the controller? For example: db.define_table("food", Field("name", "string'")) db.define_table("units", Field("food_id", db.food), Field("name", "string") ) db.define_table("ate", Field("food_id", db.food), Field("quantity",

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread mdipierro
more here: http://www.webdeveloper.com/forum/showthread.php?t=138830 On 26 Mar, 16:11, DenesL wrote: > The code is actually larger than the given example. > I guess I could minify it. > Are you sure this is browser dependent?. > > On Mar 26, 4:31 pm, mdipierro wrote: > > > I think this is browse

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread mdipierro
I a not sure. I know I tried once and it did not work (firefox). I could not find specs anywhere about this. On 26 Mar, 16:11, DenesL wrote: > The code is actually larger than the given example. > I guess I could minify it. > Are you sure this is browser dependent?. > > On Mar 26, 4:31 pm, mdipie

[web2py] Re: sqlite & development

2010-03-26 Thread Yarko Tymciurak
On Mar 26, 4:00 pm, Hillman wrote: > This is another great tool:https://addons.mozilla.org/en-US/firefox/addon/5817 > > A Firefox extension for managing Sqlite databases. Oh! Nice; and a browser plugin - yes, I like it; THanks for sharing! ;-) > > On Mar 26, 2:50 pm, Yarko Tymciurak > wrote:

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
The code is actually larger than the given example. I guess I could minify it. Are you sure this is browser dependent?. On Mar 26, 4:31 pm, mdipierro wrote: > I think this is browser dependent. I am not sure scrips in pages > loaded via ajax are always executed. That is why the web2y-component- >

[web2py] Re: plotkit realtime

2010-03-26 Thread mdipierro
I think this is browser dependent. You cannot do it. I would use a instead of {{=LOAD}} On 26 Mar, 15:58, Kuba Kucharski wrote: > I need to draw charts realtime > > I do: > $("#plot").load('http://127.0.0.1:8001/monitoring/default/plotme2', > '', call2back); > > in plotme2 I have: > =PLOT(.. > >

[web2py] Re: sqlite & development

2010-03-26 Thread Hillman
This is another great tool: https://addons.mozilla.org/en-US/firefox/addon/5817 A Firefox extension for managing Sqlite databases. On Mar 26, 2:50 pm, Yarko Tymciurak wrote: > I recently had a need to quickly look at sqlite data tables (not a > web2py app) - and was rather pleased with this tcl/

[web2py] plotkit realtime

2010-03-26 Thread Kuba Kucharski
I need to draw charts realtime I do: $("#plot").load('http://127.0.0.1:8001/monitoring/default/plotme2', '', call2back); in plotme2 I have: =PLOT(.. Which is javascript HELPER from Massimo's appliance I am loading the site with js code but javascipt is not getting executed - so I don't get to s

[web2py] sqlite & development

2010-03-26 Thread Yarko Tymciurak
I recently had a need to quickly look at sqlite data tables (not a web2py app) - and was rather pleased with this tcl/tk written tool: http://sqlitestudio.one.pl/ I will try using this for a while to monitor data during development / debugging cycles. Maybe you'll find it useful too. Regard

[web2py] Re: download URL for existing folder structure

2010-03-26 Thread mdipierro
say you have db.define_table('myfile',Field('path')) you can create an action like: def serve_myfile(): import os file_id=request.args(0) row=db.myfile[file_id] root_path = '/path/to/root/of/paths/' return response.stream(open(os.path.join(root_path,row.path),'rb'

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread mdipierro
I think this is browser dependent. I am not sure scrips in pages loaded via ajax are always executed. That is why the web2y-component- command mechanism exists. Why do you need new lines in there? On 26 Mar, 14:53, DenesL wrote: > Ended up moving the code into a SCRIPT tag as part of the response

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
Ended up moving the code into a SCRIPT tag as part of the response. This is in reply to a web2py LOAD. Any objections to doing this?. On Mar 26, 3:35 pm, DenesL wrote: > I was just getting there, since I tried adding some comments to the > code which only made it worse. > Good to know. > Thanks.

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
I was just getting there, since I tried adding some comments to the code which only made it worse. Good to know. Thanks. On Mar 26, 3:24 pm, mdipierro wrote: > Yes. response.headers cannot be multi-line. > > Massimo > > On 26 Mar, 14:15, DenesL wrote: > > > But works fine when typed like this: >

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread mdipierro
Yes. response.headers cannot be multi-line. Massimo On 26 Mar, 14:15, DenesL wrote: > But works fine when typed like this: > > response.headers['web2py-component- > command']='''jQuery('.DB').click(function(e) { >   $(e.target).removeClass('click2loadTables');} )''' > > Any ideas?. -- You rece

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
But works fine when typed like this: response.headers['web2py-component- command']='''jQuery('.DB').click(function(e) { $(e.target).removeClass('click2loadTables');} )''' Any ideas?. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
Same thing happens... ??? Response Headers Pragma no-cache Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre- check=0 web2py-component-commandjQuery('.DB').click(function(e) { $ (e.target).removeClass('click2loadTables'); Content-Typetext/html; charset=utf-8 Date

[web2py] download URL for existing folder structure

2010-03-26 Thread psikahtik
Newb question (trying to learn Python and web2py simultaneously). I've currently got a MySQL database containing records with file paths to a whole lot of images and scanned files in a deeply nested folder structure. I just want to build a simple search page to retrieve those scans. However, I'm un

[web2py] Re: cache language files

2010-03-26 Thread mdipierro
I changed this in trunk. The language files are now cached but please check that I did not not break them. Massimo On Mar 26, 11:06 am, David Zejda wrote: > Hi, > > is it true, that languages.py reads language files per request (using > read_dict)? > > If so, is it be possible to cache the loade

[web2py] Re: pass arguments to a function used by cache

2010-03-26 Thread mdipierro
a=cache.ram('%s_%s' % args,lambda args=args: load_chapter(*args),time_expire=50) On Mar 26, 10:44 am, David Zejda wrote: > Hello :) > > I'd like to do something like this: > > def load_chapter(book, chapter): >     > > args = ('Alice', 3) > a = cache.ram('%s_%s' % args, load_chapter, argument

[web2py] Re: response.headers web2py-component-command is being cut short

2010-03-26 Thread mdipierro
Can you try trunk with Rocket? Massimo On Mar 26, 11:03 am, DenesL wrote: > In my dft controller I have: > >   response.headers['web2py-component- > command']='''jQuery('.DB').click(function(e) { >   $(e.target).removeClass('click2loadTables'); > > } )''' > > response.headers['web2py-component-c

[web2py] Re: cache language files

2010-03-26 Thread mdipierro
Unfortunately it is true. I can change this. It is in my todo list. Massimo On Mar 26, 11:06 am, David Zejda wrote: > Hi, > > is it true, that languages.py reads language files per request (using > read_dict)? > > If so, is it be possible to cache the loaded languages somehow? > > Thanks! > > Da

[web2py] Re: first attempt to use mysql & web2py = unknown field type: INTEGER

2010-03-26 Thread mdipierro
Something is wrong in your model For example SQLField("employee_password", "VARCHAR", length=128,default=None)) should be Field("employee_password", "password", length=128,default=None)) field types are listed here: http://web2py.com/book/default/section/6/4 If you have 'INTEGER' it s

[web2py] first attempt to use mysql & web2py = unknown field type: INTEGER

2010-03-26 Thread Ben W.
Any ideas? I used http://gaesql.appspot.com/ to generate the code... Error traceback Traceback (most recent call last): File "/home/ben/www/web2py/gluon/restricted.py", line 173, in restricted exec ccode in environment File "/home/ben/www/web2py/applications/msi/models/db.py", line 83, i

[web2py] cache language files

2010-03-26 Thread David Zejda
Hi, is it true, that languages.py reads language files per request (using read_dict)? If so, is it be possible to cache the loaded languages somehow? Thanks! David -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send e

[web2py] response.headers web2py-component-command is being cut short

2010-03-26 Thread DenesL
In my dft controller I have: response.headers['web2py-component- command']='''jQuery('.DB').click(function(e) { $(e.target).removeClass('click2loadTables'); } )''' response.headers['web2py-component-command'] is correctly set to: "jQuery('.DB').click(function(e) {\n $ (e.target).removeClass

[web2py] pass arguments to a function used by cache

2010-03-26 Thread David Zejda
Hello :) I'd like to do something like this: def load_chapter(book, chapter): args = ('Alice', 3) a = cache.ram('%s_%s' % args, load_chapter, arguments=args, time_expire=50) where the cache would execute load_chapter('Alice', 3) if necessary. Any advices, please? Regards, David -- Y

[web2py] Re: feature request - database record locking

2010-03-26 Thread szimszon
And what if: - there is no ajax - the controller do the locking with controllable expiration - form validation checks if there is a proper lock for the record - if not invalidate the submit - if there is a lock then update/delete/... the record and release the lock it could be done with crud

[web2py] Re: MySQL server has gone away

2010-03-26 Thread mdipierro
Eventually a fix at the web2py level would not be much different than this. Massimo On Mar 26, 10:03 am, David Zejda wrote: > Thanks. The workaround works, even when keeping the pool. :) > > D. > > > try: > >     db=DAL("mysql://a:b...@localhost/c", pool_size=5) > > except: > >     db=DAL("mysql

[web2py] Re: MySQL server has gone away

2010-03-26 Thread David Zejda
Thanks. The workaround works, even when keeping the pool. :) D. > try: >     db=DAL("mysql://a:b...@localhost/c", pool_size=5) > except: >     db=DAL("mysql://a:b...@localhost/c", pool_size=5) -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To

[web2py] Re: feature request - database record locking

2010-03-26 Thread mdipierro
It requires exposing an ajax listener. It would introduce a dependency on a js library and would be more complex for the user who would have to implement the listener. Massimo On Mar 26, 9:20 am, szimszon wrote: > Seems to work. Thank you! > > Anyway I think in long term it would be better to ha

[web2py] Re: feature request - database record locking

2010-03-26 Thread szimszon
Seems to work. Thank you! Anyway I think in long term it would be better to have such feature integrated in core web2py. On márc. 26, 03:04, mdipierro wrote: > No... that  did not work. This does: > > http://web2py.com/plugins/default/locking > > On Mar 25, 5:20 pm, Massimo Di Pierro wrote: >

[web2py] Re: my problem with datatables jq

2010-03-26 Thread mdipierro
IS_DATETIME(format=T('%Y-%m-%d %H:%M:%S')) On Mar 26, 8:40 am, Kuba Kucharski wrote: > but this > IS_DATE(format=T('%H:%M:%S')) > > gives me 00:00:00 > > where in db I have > > 14:39:23 > > why? > > -- > Kuba -- You received this message because you are subscribed to the Google Groups "web2py-

Re: [web2py] Re: my problem with datatables jq

2010-03-26 Thread Kuba Kucharski
I mean your example for month/year/day seems fine but there is a problem with time -- Kuba -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email

Re: [web2py] Re: my problem with datatables jq

2010-03-26 Thread Kuba Kucharski
but this IS_DATE(format=T('%H:%M:%S')) gives me 00:00:00 where in db I have 14:39:23 why? -- Kuba -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group,

[web2py] Re: HTML tags in string

2010-03-26 Thread mdipierro
{{=XML(s)}}} and s will not be escaped. On Mar 26, 7:44 am, abiggs wrote: > Hi > > I'm currently writing a program that processes search results.  As > such, some of the strings which I am dynamically including in the page > include HTML tags.  Because they are included in {{}} in the page, > the

[web2py] Re: my problem with datatables jq

2010-03-26 Thread mdipierro
The proper way is use internationalization db.table.field.requires=IS_DATE(format=T('%Y-%m-%d')) On Mar 26, 8:02 am, Kuba Kucharski wrote: > Hi > > in datatables > > datetime is displayed like this: > > 2010-03-26 13... > > by default so i cannot see minutes and seconds > > How to change this

[web2py] Re: disabling https/local host restriction for admin?

2010-03-26 Thread mdipierro
yes, comment the checks at the top of applications/admin/models/ access.py On Mar 26, 8:00 am, Philip wrote: > Is it possible to disable the https/localhost restriction for admin > and make it accessible by http? I recognize the security issues with > doing so, but I have an app that is deployed

[web2py] Re: Ajax and Auth API

2010-03-26 Thread mdipierro
You just need a view for register.html that does not extend layout and contains a custom form. On Mar 26, 6:49 am, Yannick wrote: > Thanks Massimo, Yes it's working now... Thousand thanks... BUT I still > don't know how I can have more control on the display of each field: > Like it's possible to

[web2py] Re: feature request - database record locking

2010-03-26 Thread mdipierro
It is incomplete but good enough. On Mar 26, 12:58 am, szimszon wrote: > In sort I'll test it. > > >   I'm somewhat lost in plugin threads :( Is the plugin system stable > now? Are there any complete documentation about it in current state? > > > On márc. 26, 03:04, mdipierro wrote: > > > No..

[web2py] Re: XSS injection in jqgrid plugin

2010-03-26 Thread mdipierro
Bad. Thi can be be fixed at the web2py level but I will look if jqgrid too has an escape option. On Mar 25, 11:17 pm, "ont.rif" wrote: > May be it is not so dangerous... It is really beauty plugin, but I > easy can add any html code in table (include > tag).http://web2py.com/plugins/default/jq

[web2py] HTML tags in string

2010-03-26 Thread abiggs
Hi I'm currently writing a program that processes search results. As such, some of the strings which I am dynamically including in the page include HTML tags. Because they are included in {{}} in the page, these tags appear in text eg. "network
of Subject". Is there any way that I can make

[web2py] my problem with datatables jq

2010-03-26 Thread Kuba Kucharski
Hi in datatables datetime is displayed like this: 2010-03-26 13... by default so i cannot see minutes and seconds How to change this behaviour? I have this problem with appadmin but also when using sortable table plugin I tried setting bAutoWidth but either it doesn't work or I do smth wrong

[web2py] disabling https/local host restriction for admin?

2010-03-26 Thread Philip
Is it possible to disable the https/localhost restriction for admin and make it accessible by http? I recognize the security issues with doing so, but I have an app that is deployed behind a firewall within a small workgroup in which everyone on the local network is a trusted user (i.e. would not b

[web2py] Re: Ajax and Auth API

2010-03-26 Thread Yannick
Thanks Massimo, Yes it's working now... Thousand thanks... BUT I still don't know how I can have more control on the display of each field: Like it's possible to load each field and display them as I want ? - And I also wanted to know how to catch the error messages so I can display them like I wa

[web2py] Re: Web2py & LinkedIn/OAuth and dev_appserver too

2010-03-26 Thread Carl
hi M Could I get a copy of your example code behind: http://web2py.com/linkedin p.s. when I click login on your example I am not taken to a linked authentication page. Should I expect that? On Mar 25, 6:12 pm, Carl wrote: > This pagehttp://code.google.com/p/python-linkedin/claims "can > usehtt

[web2py] Re: wsgi won't load modules

2010-03-26 Thread Ian Reinhart Geiser
I just copied the applications folder from my test machine to the apache server. I checked and the welcome and admin apps work. It just seems the imports from modules don't work. I have them installed in the following tree: applications/vmanager applications/vmanager/modules applications/vmanage

[web2py] How to best design a date/geographic proximity query on GAE?

2010-03-26 Thread Dane
Hi all, I'm building a directory for ultimate frisbee tournaments on GAE with a Flex front end. The user selects a location, a radius, and a maximum date. I have a basic version of this query implemented, but it's inefficient and slow. One way I know I can improve it is by condensing the many indi

[web2py] Re: problem with migrating a sqlite db

2010-03-26 Thread Peter Etchells
Thanks for taking the time to look at this problem. len(dx.executesql('SELECT * from fields')) gave 43815, ie the correct answer. I finally realized it was because the anki application for some reason had a negative id about 1/3 of the records. I was just using the default query dx.fields.id > 0