[web2py] Re: convert field to multiple view values?

2010-06-06 Thread mdipierro
This is a three step process: 1) disable JS validation as float for this field form.element('input[name=height]')['_class']='feet' 2) create a custom validator that filters data in and formats data out class FEET: def __init__(self,error_message='invalid'):

[web2py] Re: web2py seems to lose session

2010-06-06 Thread João Ventura
Hello mdipierro, i only store basic python datatypes (dictionaries, floats, strings). The most complex variables that i store are dictionaries inside other dictionaries, with a max depth of 2 (i.e., a first dictionary with secondary dictionaries inside it). It is a bit strange for, while using

[web2py] Re: Newbie question on self-submitting form

2010-06-06 Thread NoNoNo
Can anyone help me with this? Still not get it.=_=

[web2py] Re: Newbie question on self-submitting form

2010-06-06 Thread mr.freeze
Try changing your redirect to this: redirect(URL(r=request, f='gotopage',args=request.vars.page_no)) On Jun 6, 6:50 am, NoNoNo coldspring830...@gmail.com wrote: Can anyone help me with this? Still not get it.    =_=

Re: [web2py] Is there a default file upload when filling forms?

2010-06-06 Thread Jason Brower
Yes. But i end up having to do that about 15 times in my document. And we all know programs creat ways to do everything once. - Original message - Sounds like you got it. if not record.image:     if record.sex == male:         return male.jpg     else:       return female.jpg

[web2py] Re: web2py seems to lose session

2010-06-06 Thread mdipierro
On Jun 6, 4:45 am, João Ventura joaojonesvent...@gmail.com wrote: Hello mdipierro, i only store basic python datatypes (dictionaries, floats, strings). The most complex variables that i store are dictionaries inside other dictionaries, with a max depth of 2 (i.e., a first dictionary with

[web2py] Re: Is there a default file upload when filling forms?

2010-06-06 Thread mdipierro
Why? I think you just need a function and call it from auth.settings.register_onvalidation auth.settings.profile_onvalidation On Jun 6, 3:57 am, Jason Brower encomp...@gmail.com wrote: Yes. But i end up having to do that about 15 times in my document. And we all know programs creat ways to

[web2py] Re: web2py seems to lose session

2010-06-06 Thread João Ventura
Hello again Massimo, and thanks for the feedback. I've been troubleshooting this all day long and i've tracked this down to a view that i have that serves 2 images and two tables with information from those two images. That view is something like (the syntax is not this, just for illustration

Re: [web2py] Is there a default file upload when filling forms?

2010-06-06 Thread Thadeus Burgess
thats why you have a VirtualField called get_image_url() that does that and everywhere you need it you go record.get_image_url() More on virtualfields here: http://thadeusb.com/weblog/archive/2009/12/31/web2py_virtualfields_as_an_orm_an_sqlalchemy_approach/27 -- Thadeus On Sun, Jun 6, 2010

[web2py] Feature request for crontab

2010-06-06 Thread Praneeth
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello all, I was wondering if the following 2 features could be added to newcron.py 1) Support sourcing application paths in crontab folder: Example: @reboot root *applications/eden/cron/sms_handler_api.py Use case: Since we are developing out

[web2py] python web console

2010-06-06 Thread Tomas Pelka
Hi all, if I'm correct web2py had a web (java script) python console. I can't find it now, is it still included? Thanks -- Tomas Pelka

[web2py] Re: web2py seems to lose session

2010-06-06 Thread João Ventura
Hello again, well, after an entire day (about 12 hours) around this, i just made a final test with a controler and view something like: img alt=1 src={{=URL(r=request,f='get_image',vars={'param':'1'})}} / img alt=2 src={{=URL(r=request,f='get_image',vars={'param':'2'})}} / img alt=3

[web2py] Re: Feature request for crontab

2010-06-06 Thread mdipierro
Good ideas. I think they can both be done. On Jun 6, 2:11 pm, Praneeth life...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello all, I was wondering if the following 2 features could be added to newcron.py 1) Support sourcing application paths in crontab folder:

[web2py] Re: python web console

2010-06-06 Thread mdipierro
There is a button [shell] from the admin/edit page for each app. On Jun 6, 3:15 pm, Tomas Pelka tompe...@gmail.com wrote: Hi all, if I'm correct web2py had a web (java script) python console. I can't find it now, is it still included? Thanks -- Tomas Pelka

[web2py] Re: web2py seems to lose session

2010-06-06 Thread mdipierro
I am not completely sure what is going on in your case but: session.forget() only affects the current action and forces web2py to release the lock on the session file and not save it. This affects only the current action in the sense that if the session was a created by a different action that

[web2py] Re: python web console

2010-06-06 Thread johntynan
You can also try the following from the command line: # in linux python web2py.py -S yourappname -M # in windows web2py.exe -S yourappname -M On Jun 6, 4:15 pm, Tomas Pelka tompe...@gmail.com wrote: Hi all, if I'm correct web2py had a web (java script) python console. I can't find it now,

[web2py] Re: python web console

2010-06-06 Thread mdipierro
This is actually better because the web based shell seems to close the db connection quite soon and we do not yet know why. Massimo On Jun 6, 5:16 pm, johntynan jgty...@gmail.com wrote: You can also try the following from the command line: # in linux python web2py.py -S yourappname -M # in

[web2py] Putting too much logic in a view

2010-06-06 Thread NetAdmin
I have a table with the following structure. firstname string stboolean I can display the info with a view, but I'd like to check/uncheck certain names using the status check box, then delete the checked names. I feel I'm going about this the WRONG way because most of the

[web2py] Re: Putting too much logic in a view

2010-06-06 Thread mr.freeze
Something like this? def delete_things(): table = TABLE() recs = db(db.things.id 0).select() for rec in recs: chk = INPUT(_type='checkbox', _name='st_%s' % rec.id) table.append(TR(rec.id,rec.name,chk)) form = FORM(table,INPUT(_type='submit'))

[web2py] Keep the instance of a class during the session

2010-06-06 Thread Jose
I have a module (in my_app / modules) that defines a class MyClass. This class operates with model data. In the __init__ there is a heavy workload, and data are available for other minor calculations. What I want is to create an instance of MyClass [my_object = MyClass (...)] a function of my

[web2py] Re: Putting too much logic in a view

2010-06-06 Thread NetAdmin
I'll give it a try. Thanks! On Jun 6, 7:10 pm, mr.freeze nat...@freezable.com wrote: Something like this? def delete_things():     table = TABLE()     recs = db(db.things.id 0).select()     for rec in recs:         chk = INPUT(_type='checkbox',                     _name='st_%s' %

[web2py] Re: Putting too much logic in a view

2010-06-06 Thread NetAdmin
Perfect! Thanks so much! One thing I've been thinking about, is putting together a reference database that will help newbies learn from working examples. As I browse the forum, I see people asking things such as How do I populate a drop-down list from a table. Providing a reference database

[web2py] fastcgi install not working

2010-06-06 Thread Cory Coager
I just setup a new install of web2py on a shared host. Using the fastcgi instructions results in the webpage displaying the contents of dispatch.fcgi instead of executing it. What am I doing wrong? Here is dispatch.fcgi: #!/usr/bin/env /home/user/w2env/bin/python import sys from

Re: [web2py] Keep the instance of a class during the session

2010-06-06 Thread Thadeus Burgess
cache the object. -- Thadeus On Sun, Jun 6, 2010 at 7:23 PM, Jose jjac...@gmail.com wrote: I have a module (in my_app / modules) that defines a class MyClass. This class operates with model data. In the __init__ there is a heavy workload, and data are available for other minor

[web2py] Quick fetch modification

2010-06-06 Thread szabba
I've just made a quick modification to the fetch function from gluon.tools and felt it might be worth posting. http://wklej.to/rLuT - I've pasted the code online since I didn't really have time for sending a proper patch (whatever would that mean for web2py - BTW, some guide about it wouldn't

[web2py] Re: Keep the instance of a class during the session

2010-06-06 Thread mdipierro
I depends on whether the data is different for each user of shared between users. In the latter case Thadeus is right: cache it. You can store any object in cache.ram value=cache.ram('key',lambda:function_that_computes_value(),expiration_time) If the data is per user you can store it in session

[web2py] Re: Quick fetch modification

2010-06-06 Thread mdipierro
I will look at it later today or tomorrow. Thanks you! On Jun 6, 9:12 pm, szabba isza...@gmail.com wrote: I've just made a quick modification to the fetch function from gluon.tools and felt it might be worth posting. http://wklej.to/rLuT- I've pasted the code online since I didn't really

[web2py] Re: news?

2010-06-06 Thread Richard
more info here: http://www.techfuel.net/zblog/blog/view/24 On Jun 6, 3:08 am, Joschua cit_corperat...@gmx.net wrote: i'm sorry. i wanted to answer in this threadhttp://groups.google.com/group/web2py/browse_thread/thread/1857d9db96... ^^ Is there a public repository? Maybie I could work on

Re: [web2py] Re: parsehtml

2010-06-06 Thread Álvaro Justen
This project: http://github.com/gabrielfalcao/dominic#readme was created by a Brazilian. Maybe it can helps with web2py HTMLParser. -- Álvaro Justen - Turicas http://blog.justen.eng.br/ 21 9898-0141

[web2py] Re: parsehtml

2010-06-06 Thread mdipierro
Amazing. Very similar. One thing that web2py TAG is missing it the ability to guess encoding. It fails and.or does mistakes if the source is not UTF8 encoded. On Jun 6, 10:57 pm, Álvaro Justen alv...@justen.eng.br wrote: This project:http://github.com/gabrielfalcao/dominic#readme was created by

[web2py] Re: news?

2010-06-06 Thread mdipierro
Is there a source we can look at? On Jun 6, 10:04 pm, Richard richar...@gmail.com wrote: more info here:http://www.techfuel.net/zblog/blog/view/24 On Jun 6, 3:08 am, Joschua cit_corperat...@gmx.net wrote: i'm sorry. i wanted to answer in this

[web2py] about SQLTABLE and truncate

2010-06-06 Thread kike
Hello, I read the online book and I have a doubt, how I change the value of a truncate parameter, to never truncate text in table cell or change to another value, because in the online book not explain how doit. Thank for your help

[web2py] Re: about SQLTABLE and truncate

2010-06-06 Thread mdipierro
SQLTABLE(,truncate=32) On Jun 6, 11:42 pm, kike eacarm...@estudiantes.uci.cu wrote: Hello, I read the online book and I have a doubt, how I change the value of a truncate parameter, to never truncate text in table cell or change to another value, because in the online book not explain how

[web2py] Re: Support for Indian Languages

2010-06-06 Thread Rahul
Hi Massimo, Hi Massimo, Here are the translation files I intend to get. 1- Marathi mr-mr or (mar-mar) code is mr-IN 2- Gujrathi gu-gu (gu-IN) 3- Tamil ta-ta (ta-IN) 4- Bengali bn-bn (bn-IN) 5- Punjabi pa-pa (pa-IN) 6- Malayalam ml-ml (ml-IN) 7- Telugu te-te (te-IN) 8-

[web2py] Re: Support for Indian Languages

2010-06-06 Thread Rahul
Hi Anand, Yes that's a good idea, we can collaborate. But I am not familiar with translations. Also, I can provide help as and when time permits. Its a real busy schedule for me here. Let me know what you think. Also, I am happy we've got some people here in India working on web2py and

[web2py] Re: Support for Indian Languages

2010-06-06 Thread mdipierro
plugin translate uses google for translation. It cannot be made to work offline. On Jun 7, 12:02 am, Rahul rahul.dhak...@gmail.com wrote: Hi Massimo,              Hi Massimo,            Here are the translation files I intend to get. 1- Marathi mr-mr or (mar-mar) code is mr-IN 2- Gujrathi

[web2py] Re: about SQLTABLE and truncate

2010-06-06 Thread kike
thank, is very easy, if i need not truncate the following sentence is correct??? SQLTABLE(,truncate=None) On Jun 7, 6:55 am, mdipierro mdipie...@cs.depaul.edu wrote: SQLTABLE(,truncate=32) On Jun 6, 11:42 pm, kike eacarm...@estudiantes.uci.cu wrote: Hello, I read the online book

[web2py] Re: Support for Indian Languages

2010-06-06 Thread Rahul
Hi Massimo, I see, but a general question when we use inbuilt translation of web2py say like T(abc) or something in the web2py app, then would it work offline? Thanks, Rahul On Jun 7, 10:05 am, mdipierro mdipie...@cs.depaul.edu wrote: plugin translate uses google for translation. It

[web2py] Re: about SQLTABLE and truncate

2010-06-06 Thread mdipierro
sorry not. But you can choose a very large value like 10**10 On Jun 7, 12:26 am, kike eacarm...@estudiantes.uci.cu wrote: thank, is very easy, if i need not truncate the following sentence is correct??? SQLTABLE(,truncate=None) On Jun 7, 6:55 am, mdipierro mdipie...@cs.depaul.edu wrote:

[web2py] Re: Support for Indian Languages

2010-06-06 Thread mdipierro
yes. In this case the translation is done by web2py beased in provided translation strings. On Jun 7, 12:47 am, Rahul rahul.dhak...@gmail.com wrote: Hi Massimo,          I see, but a general question when we use inbuilt translation of web2py say like T(abc) or something in the web2py app,