[web2py:35779] Re: Internationalization

2009-11-22 Thread szimszon
I don't understand all of the thread but if I may ask something. Are you found the bug that makes no translation of the flash message in the video at 6:20min? I'm puzzled only because that there is something translated and something not... On Nov 18, 9:03 pm, mdipierro wrote: > I think you foun

[web2py:35780] Extremely basic question about view

2009-11-22 Thread jensmun
Hi, Typical case of embarrassing situation. I don't know anything about programming and wanted to try this out. Unfortunately I can't even get my head around extensions of views. And I can't seem to find a description of something this basic. I've tried stripped the example app in web2py from ev

[web2py:35781] Re: Internationalization

2009-11-22 Thread mdipierro
Hi Szimszon, I agree with you that from the video that is a bug but I failed to reproduce it. Can you reproduce it with the latest web2py? Massimo On Nov 22, 3:54 am, szimszon wrote: > I don't understand all of the thread but if I may ask something. > > Are you found the bug that makes no tran

[web2py:35782] Re: Extremely basic question about view

2009-11-22 Thread mdipierro
Perhaps you are talking about something equivalent to Django blocks? We do not have that. We have other ways to do a similar thing. There are two basic things you can do: 1) Extending #extedened.html {{include}} #extending.html {{extends 'extended.html'}}Hello 2) Including #including.html {{inc

[web2py:35785] Can't load web2py GAE on version 1.72.3

2009-11-22 Thread Julian Yap
Is it me or is this issue happening again? Running GAE 1.2.7 and latest web2py from SVN. $ google_appengine/dev_appserver.py web2py_svn/ /home/me/google_appengine/google/appengine/tools/appcfg.py:41: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha /h

[web2py:35784] Displaying image fields using SQLFORM

2009-11-22 Thread Khaled ElAdawy
Hi, I use SQLFORM to add / update records in a database table where some of the fields are images. Is there any way to display the current stored image of image fields for the user (same like in CRUD)? Regards, --~--~-~--~~~---~--~~ You received this message becaus

[web2py:35783] Populating database

2009-11-22 Thread harshit agrawal
sir, I am populating my database by filling forms. But I don't want to fill long forms again and again. Is there a way to populate the database in one shot . If Yes, please explain... Thank You waiting for response harshit --~--~-~--~~~---~--~~ You received this m

[web2py:35786] Re: Populating database

2009-11-22 Thread mdipierro
With random data or with your own data? 1) With random data: from gluon.contrib.populate import populate populate(db.table,1000) # will fill db.table with 1000 records 2) With your own data I depends on where the data is. You can create a controller action that loops and db.table.insert(fiel

[web2py:35787] Re: Displaying image fields using SQLFORM

2009-11-22 Thread mdipierro
Yes: SQLFORM(,upload=URL(r=request,c='default',f='download')) On Nov 22, 5:32 am, Khaled ElAdawy wrote: > Hi, > I use SQLFORM to add / update records in a database table where some > of the fields are images. > Is there any way to display the current stored image of image fields > for the u

[web2py:35788] Re: Can't load web2py GAE on version 1.72.3

2009-11-22 Thread mdipierro
The error is /usr/lib64/python2.6/uuid.py I think you are runn dev_appserver with python2.6 but you should be using 2.5. Massimo On Nov 22, 5:49 am, Julian Yap wrote: > Is it me or is this issue happening again?  Running GAE 1.2.7 and > latest web2py from SVN. > > $ google_appengine/dev_appse

[web2py:35789] an error in page 219

2009-11-22 Thread hamdy.a.farag
Hi I don't know whether some one else reported this or not , and I'm sorry if so Manual, page 219 has an error : form.custom.labels[fieldname] , it should be form.custom.label [fieldname] labels is wrong and the right is label --~--~-~--~~~---~--~~ You received

[web2py:35790] Re: an error in page 219

2009-11-22 Thread mdipierro
thanks. Could you please add it here: http://wiki.web2py.com/Errata_for_web2py_2nd_Edition_Book On Nov 22, 10:38 am, "hamdy.a.farag" wrote: > Hi > I don't know whether some one else reported this or not , and I'm > sorry if so > Manual, page 219 has an error : > > form.custom.labels[fieldname]  

[web2py:35791] regexp a file after being uploaded

2009-11-22 Thread Daniel Antonio Aguayo Catalán
Hello, I need to pass some regexp through a file just after being uploaded, for then save the results in a dict or something, but I have problems to realize the code for this because I'm just learning python while using web2py. Any help is appreciated. Thanks in advance :) Regards -- Daniel

[web2py:35792] Re: regexp a file after being uploaded

2009-11-22 Thread mdipierro
This is not a trivial question. Say you have db.define_table('data',Field('atob','upload')) form=crud.create(db.data, onaccept=process_file) Here is an example of a process the atob upload field and replaces 'a' with 'b'. def process_file(form): filename = form.vars.atob_newfilename pa

[web2py:35793] Re: an error in page 219

2009-11-22 Thread hamdy.a.farag
couldn't edit the errata page, so I added a comment with the error --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe fro

[web2py:35794] Re: Can't load web2py GAE on version 1.72.3

2009-11-22 Thread Julian Yap
Thanks Massimo. I wasn't aware Python 2.5 required for GAE. On Nov 22, 5:21 am, mdipierro wrote: > The error is > > /usr/lib64/python2.6/uuid.py > > I think you are runn dev_appserver with python2.6 but you should be > using 2.5. > > Massimo > > On Nov 22, 5:49 am, Julian Yap wrote: > > > Is i

[web2py:35795] Best way to allow for multiple uploads in a form?

2009-11-22 Thread mr.freeze
I've prototyped a few ways to do this but thought I would check to see if anyone had a slick way already figured out (or possibly a built-in way I missed). Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web

[web2py:35796] Re: Populating database

2009-11-22 Thread mr.freeze
Any chance you could add populate to svn? On Nov 22, 9:19 am, mdipierro wrote: > With random data or with your own data? > > 1) With random data: > > from gluon.contrib.populate import populate > populate(db.table,1000) # will fill db.table with 1000 records > > 2) With your own data > I depends

[web2py:35797] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mdipierro
Can you please check the fix in trunk? Massimo On Nov 21, 6:51 pm, mdipierro wrote: > well' This is a bug. I think the proper fix would be to edit html.py > and make sure that only checked boxes display the error. > > On Nov 21, 6:15 pm, "mr.freeze" wrote: > > > Here's a lame workaround. It's

[web2py:35798] Re: Populating database

2009-11-22 Thread mdipierro
done. On Nov 22, 3:39 pm, "mr.freeze" wrote: > Any chance you could add populate to svn? > > On Nov 22, 9:19 am, mdipierro wrote: > > > With random data or with your own data? > > > 1) With random data: > > > from gluon.contrib.populate import populate > > populate(db.table,1000) # will fill db

[web2py:35799] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mr.freeze
You fixed it too much :) It doesn't give an error at all now. On Nov 22, 3:48 pm, mdipierro wrote: > Can you please check the fix in trunk? > > Massimo > > On Nov 21, 6:51 pm, mdipierro wrote: > > > well' This is a bug. I think the proper fix would be to edit html.py > > and make sure that only

[web2py:35800] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mdipierro
lol. Please check again the code in trunk. Anyway, reading again the original post... > form = SQLFORM.factory(Field('multiple_options', requires=IS_IN_SET(('Hi', > 'Milk', 'Mom', 'Love', 'Santa')), widget=SQLFORM.widgets.checkboxes.widget)) This was wrong to begin with. It is not clear if this

[web2py:35801] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mr.freeze
It works now. > This was wrong to begin with. It is not clear if this should be I don't understand. The example is a valid form. The only problem was that it had an error div for each checkbox. Why is it wrong? On Nov 22, 5:55 pm, mdipierro wrote: > lol. Please check again the code in trunk.

[web2py:35802] Re: web2py job on GetAFreelancer

2009-11-22 Thread Richard
another web2py job: http://www.getacoder.com/projects/python%20web%20py_115969.html """ I need a python developer to take over the current small website (3-4 pages but more than 1000 users in mysql databses ) under linux and customize some scripts You must have good knowledge in Python web2py fr

[web2py:35803] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mdipierro
Because IS_IN_SET(,multiple=False) implies an exclusive choice. In this case you must use radio buttons, not checkboxes. On Nov 22, 6:13 pm, "mr.freeze" wrote: > It works now. > > > This was wrong to begin with. It is not clear if this should be > > I don't understand. The example is a valid f

[web2py:35804] Re: Checkboxes display errror on each input, instead of just once for the widget.

2009-11-22 Thread mr.freeze
Yes, but having no default means that the user will be required to actively choose. I like that. Anyway, i'm splitting hairs. Thanks for the patch. On Nov 22, 7:59 pm, mdipierro wrote: > Because IS_IN_SET(,multiple=False) implies an exclusive choice. In > this case you must use radio buttons,

[web2py:35805] Dynamic data refresh

2009-11-22 Thread Vincent
I have a simple form that send the data to a module, this python module/program, it takes several minutes to finish. Then it saves a few matplotlib plots and calculates s a few values. although not proficient I can get the plots and values on a second page. When the program is running in terminal

[web2py:35806] Re: Dynamic data refresh

2009-11-22 Thread mdipierro
I have heard of it but never used. My suggestion is for long running tasks 1) queue starts in a database 2) run a background process to perform tasks sequentially and mark the db entry as "queued", "in progress", "failed", "completed" 3) create a page with an ajax keepalive that checks the status

[web2py:35807] validity of file

2009-11-22 Thread Thadeus Burgess
Is there a way, through SQLFORM to open a file, and make sure it is the kind of file you are expecting. I would like to check to see if the files users are uploading, are indeed w2p tarred files with only .py files with a naming scheme in them. I know I could use SQLFORM.factory and then open the

[web2py:35808] Re: validity of file

2009-11-22 Thread mdipierro
There a IS_IMAGE that can check for BMP, GIF, JPEG, and PNG. You can copy and modify it to check for other formats. What formats are you thinking about? On Nov 22, 9:41 pm, Thadeus Burgess wrote: > Is there a way, through SQLFORM to open a file, and make sure it is the kind > of file you are exp

[web2py:35809] Re: Extremely basic question about view

2009-11-22 Thread Thadeus Burgess
Would blocks be too much to ask for? -Thadeus On Sun, Nov 22, 2009 at 9:15 AM, mdipierro wrote: > > Perhaps you are talking about something equivalent to Django blocks? > We do not have that. > We have other ways to do a similar thing. There are two basic things > you can do: > > 1) Extendin

[web2py:35810] Re: Internationalization

2009-11-22 Thread Thadeus Burgess
I can see needing something translating into English. If a developer writes all of his code in Spanish, using Spanish variables, messages, etc... it would need to be translated into English. I have noticed quite a few users on this mailing list that program in languages other than English. -Thadeu

[web2py:35811] Re: validity of file

2009-11-22 Thread Thadeus Burgess
This is for uploaded plug-ins (for plugincentral). I want to make sure they are actually tarred archives with python code in them. I need to check the actual file contents instead of just the filename (which gets checked first, to make sure it is "web2py.plugin.*.w2p" -Thadeus On Sun, Nov 22,

[web2py:35812] Re: Extremely basic question about view

2009-11-22 Thread mdipierro
Here is my problem with blocks: #extended {{block a}}hello{{endblock}} world {{block b}}hello{{endblock}} #extending {{block a}}HELLO{{endblock}} WORLD {{block b}}HELLO{{endblock}} where does WORLD go? It gets lost. Blocks are convenient and not well defined. I believe {{def a():}}HELLO{{retur

[web2py:35813] Re: Internationalization

2009-11-22 Thread mdipierro
I think the issue is, since default tools.auth messages are in english, should the current_languages be set to default 'en' or should the programmer always explicitly say which languages do not need translation? On Nov 22, 9:49 pm, Thadeus Burgess wrote: > I can see needing something translating

[web2py:35814] Re: Extremely basic question about view

2009-11-22 Thread Thadeus Burgess
I think you're trying to use blocks incorrectly. Blocks are defined in a base template that is to be extended. When the extending template declares a block that exists in the parent template, it will replace everything in between the parent block, like inheritance and overriding. However the parent

[web2py:35815] Re: Internationalization

2009-11-22 Thread Thadeus Burgess
if web2py is mostly written in English, then it needs to default to English, and allow for easy overriding of this default. -Thadeus On Sun, Nov 22, 2009 at 10:04 PM, mdipierro wrote: > rammer always explicitly say which languages do not need > transla > --~--~-~--~~

[web2py:35816] Restructured Text

2009-11-22 Thread Johann Spies
I am building a website which inter alia will provide documentation for our system administrators. What will be the best way to provide documentation which was created using python-sphinx on a web2py site? With my limited knowledge of web2py the only way I know of would be to provide it as static

[web2py:35817] How to delete file uploaded via SQLFORM.factory()?

2009-11-22 Thread Iceberg
I noticed that a file uploaded via SQLFORM.factory() exists in myapp/ uploads. How to delete them automatically? By the way, shall the auto-deletion be web2py's default behaviour? Since using SQLFORM.factory() hints no need to keep those file at all. Code for reproducing the problem. def foo():