[web2py] Multiline labels for fields in SQLForm

2010-06-14 Thread Johann Spies
I would like to have multiline labels for fields in input forms. Is it possible to use SQLForm to produce that or should I do by hand using FORM? Regards Johann -- Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are

[web2py] Re: WebFactional restart web2py

2010-06-14 Thread Pai
ahhh thank you thank you :) I was looking for document about web2py on the webfactional site but only thing I found that that one pager! Pai On Jun 14, 12:56 am, Yarko Tymciurak resultsinsoftw...@gmail.com wrote: On Jun 14, 12:42 am, Pai pai.siwamut...@gmail.com wrote: Hi, total noob

[web2py] Re: Pycon APAC and Web2py

2010-06-14 Thread Anand Vaidya
Some quick updates: 1) The labnote book is released as an Opensource app and it can be found @ http://cynote.sourceforge.net/ They are actually using the app as a digital journal 2) Met zoom quiet :-) 3) I did a lightning talk on web2py and demo'd just enough web2py. Heard later from some

[web2py] Re: Struggling with file upload ... yet again :(

2010-06-14 Thread weheh
So I'm back to filename=db.book.filename.store(request.vars.filename.file,request.vars.filename.filename). Now it runs without errors, the destination file is properly created, but it's contents are blank.

[web2py] Re: Multiline labels for fields in SQLForm

2010-06-14 Thread weheh
I believe you ought to be able to do that by setting labels in your models and possibly using the XML() helper to encapsulate the labels that have BR() in them. On Jun 14, 2:14 am, Johann Spies johann.sp...@gmail.com wrote: I would like to have multiline labels for fields in input forms.  Is it

[web2py] Re: Problem with inserting a text in a database field

2010-06-14 Thread Berti
I tried to cut the string to insert for 10 characters. Now it stops at an other point, about 400 messages later and I get the following error. I cannot sort that out. Traceback (most recent call last): File /Applications/web2py/gluon/restricted.py, line 178, in restricted exec ccode in

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Niphlod
You can use request.now, that is a default datetime.datetime object.. e.g. (paste this on the view) p month: {{=request.now.month}} /p p day : {{=request.now.day}} /p ... On 14 Giu, 00:32, Giuseppe Luca Scrofani glsdes...@gmail.com wrote: Hi, how I can insert in a page not served by a

[web2py] Re: working with views or stored procedures.

2010-06-14 Thread Niphlod
you should set a primaryekey into the definition of the table.. (see http://groups.google.com/group/web2py/msg/c9848792a8999c5f) I think that simple selects are possibile on views On 13 Giu, 08:57, Sky hmonfa...@gmail.com wrote: I need to display data from a VIEW ( not table) of database.

[web2py] Re: database locked SQLITE

2010-06-14 Thread mdipierro
please tell us more about the conditions that cause it. If you use the shell (or background process) at the same time as the web app make sure you unlock the db with periodic db.commit() Massimo On Jun 12, 9:42 pm, dbb asefa.deb...@gmail.com wrote: Help resolving this issue, the database keeps

[web2py] Re: Internationalization of invalidators' error_message

2010-06-14 Thread mdipierro
Because T is defined in your apps but not in the modules. We could fix this by redefining T using thread local variables. We'll work on this. On Jun 13, 5:28 am, dlin dlin...@gmail.com wrote: I don't understand why not the invalidators' error_message only use English. eg. class

[web2py] Re: kpax cms: issue fixing - gae compatibility - refactoring

2010-06-14 Thread mdipierro
I am out of town with a limited and slow network access for the next two weeks. We will try post this asap. Thank you. On Jun 13, 10:05 am, molhokwai molhok...@gmail.com wrote: Hello all, Modified a few things in kpax to make it compatible with gae. (files attached, or pasted below). And not

[web2py] Re: Select the most recent entry from multiple tables

2010-06-14 Thread mdipierro
You have to merge them in a list and sort them at the Python/web2py level. You may be able to do dataset_three=(dataset_one+dataset_two).sort(lambda row: row['sortfilename']) assuming both tables have the same sortfiledname and have similar record structures. Try and let us know. On Jun 13,

[web2py] Re: working with views or stored procedures.

2010-06-14 Thread Jose
I am working with a legacy database and am using many views, so as to bridging differences with tables. All the views will create a numeric id field for compatibility, but not in use. Jose

[web2py] my app instead of welcome app???

2010-06-14 Thread Jean-Guy
Hello, Can't figure it out how to let my app load at 127.0.0.1 on prod server apache under ubuntu... I remove the welcome app and web2py still search to load it. Thanks Jonhy

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread mdipierro
This line: self._execute(SET sql_mode='NO_BACKSLASH_ESCAPES';) is important for security issues. SQL injections may be possible if you comment it. I do not know why it does not work on your system. It should

[web2py] Re: Internal error

2010-06-14 Thread mdipierro
this should work with 8.1 and later. Is it possible that it is fixed at the postgres configuration file? On Jun 13, 9:42 pm, Cory Coager ccoa...@gmail.com wrote: Here is the error when using PostGreSQL: Traceback (most recent call last): File gluon/restricted.py, line 178, in restricted exec

[web2py] Re: import of web2py modules very complicated

2010-06-14 Thread mdipierro
It depends. If you want to import any NORMAL python module, put it in site packages and import it using normal python syntax. If you want to import web2py modules, i.e. modules that belong to a specific application only, then you have to follow the rules and not all modules can be imported this

[web2py] Re: upload file -- lot of file in one directory

2010-06-14 Thread mdipierro
This is not supported. this would break your ability to retrieve the files you uploaded. On Jun 13, 10:33 am, weheh richard_gor...@verizon.net wrote: Aha! So then could you write the following: import random Field('filename','upload',  

[web2py] Re: Multiple form submission - is doc wrong?

2010-06-14 Thread mdipierro
I just tried it from the shell form=SQLFORM(db.auth_user) form.accepts({},formname='form1') False print form form action= enctype=multipart/form-data method=postinput name=_formname type=hidden value=form1 //div/form I think the manual is correct. Something else is wrong in your code. On

[web2py] Re: Multiline labels for fields in SQLForm

2010-06-14 Thread mdipierro
label=SPAN('line1',BR(),'line2') On Jun 14, 1:14 am, Johann Spies johann.sp...@gmail.com wrote: I would like to have multiline labels for fields in input forms.  Is it possible to use SQLForm to produce that or should I do by hand using FORM? Regards Johann -- Finally, brethren,

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread mdipierro
No do not worry. The import only happes the first time, than the module is cached. On Jun 13, 5:32 pm, Giuseppe Luca Scrofani glsdes...@gmail.com wrote: Hi, how I can insert in a page not served by a controller (think layout.html in the welcome application) current day and month? I've tested

Re: [web2py] my app instead of welcome app???

2010-06-14 Thread Vasile Ermicioi
create routes.py (or rename routes.example.py) from web2py folder routes_in = ( ('/', '/yourappname/'), ) and restart web2py

[web2py] FW: Okinawa Institute of Science and Technology - Experienced manager of high-performance computing systems - Okinawa

2010-06-14 Thread DiPierro, Massimo
FYI From: Jeff [knightjeff...@gmail.com] Sent: Sunday, June 13, 2010 11:40 PM To: DiPierro, Massimo Subject: Fwd: Okinawa Institute of Science and Technology - Experienced manager of high-performance computing systems - Okinawa Dr DiPierro, I was

[web2py] Re: my app instead of welcome app???

2010-06-14 Thread mdipierro
or simply call your app init On Jun 14, 7:19 am, Vasile Ermicioi elff...@gmail.com wrote: create routes.py (or rename routes.example.py) from web2py folder routes_in = ( ('/', '/yourappname/'), ) and restart web2py

[web2py] Problem with two forms in one page(one post, other get)

2010-06-14 Thread Lisandro Rostagno
I have tried this: def mytest(): form_one = SQLFORM.factory() form_two = SQLFORM.factory() if form_one.accepts(request.vars, session, formname='one'): response.flash = 'Form one' if form_two.accepts(request.vars, session, formname='two'): response.flash = 'Form

Re: [web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Giuseppe Luca Scrofani
Thanks for answering friends, it worked! Now, how I can setup a condition block to transform the digit returned by {{=request.now.month}} (example: 6) into something like giugno (june in italian language)? e.g. (paste this on the view) p month: {{=request.now.month}} /p p day :

Re: [web2py] Re: multiple select jquery plugin

2010-06-14 Thread Jean-Guy
On 2010-06-10 15:05, mr.freeze wrote: Another option: http://www.web2pyslices.com/main/slices/take_slice/70 On Jun 10, 2:02 pm, mdipierromdipie...@cs.depaul.edu wrote: http://web2py.com/plugins/default/multiselect On Jun 10, 1:57 pm, Jean Guyjean...@gmail.com wrote: I don't

[web2py] [BUG] solution for form.custom.widget and custom widget

2010-06-14 Thread ont.rif
For complex widgets there is bug. During form validation _traverse method doesn't change form.custom.widget. But field.widget(field, value) return correct representation. This is lead to wrong field widget output for custom form and custom widget when error occurred. Solution is simple: ---

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread The Czar
I am not running V5.5 MySQL - I am using mysql v4.1.25. Maybe a difference there! On Jun 14, 5:06 am, mdipierro mdipie...@cs.depaul.edu wrote: This line:             self._execute(SET sql_mode='NO_BACKSLASH_ESCAPES';) is important for security issues. SQL injections may be possible if you

[web2py] Re: Unable to connect to mysql DB - sql.py mod

2010-06-14 Thread The Czar
I just checked the docs for the older version (4.1) SQL Modes. There is no mention of the NO_BACKSLASH_ESCAPES mode. http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html We have some unintended consequences. I'm surprised it doesn't complain about this. On Jun 14, 5:06 am, mdipierro

Re: [web2py] Re: Select the most recent entry from multiple tables

2010-06-14 Thread Giuseppe Luca Scrofani
I've tried, I get this when trying to add dataset_one and two: TypeError: unsupported operand type(s) for +: 'Rows' and 'Rows' I feel there is something to do before adding, like convert to another datatype, but my incompetence limits me... (I hope I dont stretch my luck with all this

[web2py] My table won't appear in auth_permission : table name

2010-06-14 Thread Jean-Guy
Hello web2py crowd, How can I make appear my tables in auth_permission table name dropbox? Does that I should be able to define permission on them? Thank you. Jonhy

[web2py] Re: Internal error

2010-06-14 Thread Cory Coager
According to the postgresql 8.1 documentation, standard_conforming_strings is a read-only variable. http://postgresql2.openmirrors.org/docs/8.1/static/release-8-1.html

[web2py] error auth_user already exists

2010-06-14 Thread annet
I altered something in the db.py file, the file contains the following custom auth_user table: auth.settings.table_user = db.define_table('auth_user', Field('first_name',length=24,default=''), Field('last_name',length=42,default=''),

Re: [web2py] error auth_user already exists

2010-06-14 Thread Jean-Guy
On 2010-06-14 11:34, annet wrote: ed something in the db.py file, the file contains the following custom auth_user table: If you are developping and testing using sqlite and your database not content important data... I think you can just erase everything in database folder... Jonhy

[web2py] Re: kpax cms: issue fixing - gae compatibility - refactoring

2010-06-14 Thread Christopher Steel
Cool, thanks Molhowkwai. Chris On Jun 13, 11:05 am, molhokwai molhok...@gmail.com wrote: Hello all, Modified a few things in kpax to make it compatible with gae. (files attached, or pasted below). And not willing to continue, for the moment. If there is a version that is, 'll be happy to  

[web2py] Defining db.py for the first time problem (db references possible?)

2010-06-14 Thread zsouthboy
Problem: I don't see how to specify multiple tables with table references to each other. I can't simply define the relationship, because the DAL hasn't created a table yet to reference. But I can't create the table(s) because they reference tables that also don't exist yet. Catch 22. Besides

[web2py] Help needed adding rows to a database table...

2010-06-14 Thread Jeff Elkner
It is the end of the school year and my students and I are trying to create simple projects using web2py. Can you point me to a simple example of web2py creating and accessing a database? By simple I mean from the teaching perspective. I wanted to create a little application that stored quotes

[web2py] Setting up a web2py server...

2010-06-14 Thread Jeff Elkner
Hi Massimo, I'm still working on a recipe for setting up a web2py server on Ubuntu 10.04. I've asked the help of a friend, Douglas Cerna, who does not know web2py, but who is a Zope 3 developer on the SchoolTool project. We are interested in using web2py to create websites for some schools with

[web2py] Re: error auth_user already exists

2010-06-14 Thread annet
Hi Jonhy, Thanks for your reply. I am using PostgreSQL, and the auth_ tables contain data, so I cannot simply drop them, empty the databases folder and redefine them. I hope there is a solution which allows me to keep the tables in the PostgreSQL database. Kind regards, Annet.

Re: [web2py] Re: error auth_user already exists

2010-06-14 Thread Jean-Guy
On 2010-06-14 13:18, annet wrote: is a solution which allows me to keep the tables in the PostgreSQL database. ,migrate=False : at the end of your model... Ex.: db.define_table('atable', SQLField('var1'), SQLField('var2'),migrate=False) modify your table in postgres and define

[web2py] Re: My table won't appear in auth_permission : table name

2010-06-14 Thread Jean-Guy
On 2010-06-14 10:59, Jean-Guy wrote: Hello web2py crowd, How can I make appear my tables in auth_permission table name dropbox? Does that I should be able to define permission on them? Thank you. Jonhy Answering to myself... Here is the solution :

[web2py] Re: Defining db.py for the first time problem (db references possible?)

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 8:51 am, zsouthboy zsouth...@gmail.com wrote: Problem: I don't see how to specify multiple tables with table references to each other. I can't simply define the relationship, because the DAL hasn't created a table yet to reference. But I can't create the table(s) because they

Re: [web2py] Re: Multiline labels for fields in SQLForm

2010-06-14 Thread Johann Spies
On 14 June 2010 14:17, mdipierro mdipie...@cs.depaul.edu wrote: label=SPAN('line1',BR(),'line2') Thanks! Johann -- Finally, brethren, whatsoever things are true, whatsoever things are honest, whatsoever things are just, whatsoever things are pure, whatsoever things are lovely, whatsoever

[web2py] Re: Help needed adding rows to a database table...

2010-06-14 Thread Yarko Tymciurak
Hi Jeff - Have a look at the examples in Chapter 3 - http://www.web2py.com/book/default/section/3, particularly leading into http://www.web2py.com/book/default/section/3/5 This should help you get your example working. It is also helpful to think of the flow through web2py of the request /

[web2py] Re: Help needed adding rows to a database table...

2010-06-14 Thread Yarko Tymciurak
... you can also look at http://web2py.com/examples/default/examples, perhaps example 30 onward. (Someone sent a post noting you have this same examples application in your local web2py - unfortunately, the message would not post with the localhost links it contained). On Jun 14, 1:36 pm,

[web2py] rocket.ssl not found

2010-06-14 Thread davidjensen
I am running 1.79.2 on red hat enterprise linux with python 2.5 on a hosting service with static ip and using port 8080. I have openssl. I am getting the error message use kill -SIGTERM 2457 to shutdown the web2py server Traceback (most recent call last): File web2py.py, line 20, in module

[web2py] Documentation on moving common code into modules?

2010-06-14 Thread David Mitchell
Hello all, I'm at early days in my 1st serious web2py project, and I've got a few bits of code that are common to multiple different controllers. I want to move these code blocks into their own separate code module so they can be maintained at a single place, but I can't find any documentation

Re: [web2py] Documentation on moving common code into modules?

2010-06-14 Thread Robert O'Connor
throw it into the modules directory in its own file say foo.py -Rob On Mon, Jun 14, 2010 at 5:11 PM, David Mitchell monch1...@gmail.com wrote: Hello all, I'm at early days in my 1st serious web2py project, and I've got a few bits of code that are common to multiple different controllers.

[web2py] Re: PIL to change images on the fly...

2010-06-14 Thread howesc
on GAE i use: def download(): ...do stuff return img.execute_transforms(images.JPEG) where the google image object (img) returns a binary stream as a result of execute_transforms. if you return just binary data from a controller function in web2py, web2py does nothing more to the return, it

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 4:21 pm, Robert O'Connor robby.ocon...@gmail.com wrote: throw it into the modules directory in its own file say foo.py -Rob or perhaps utils.py - note that modules will need to be imported everywhere you want to use them (which is ok - use local_import()); An alternative is to

[web2py] Syntax highlighting for multiline string with pound character

2010-06-14 Thread Meteormarc
In the controller, when I have a multiline string with a pound (#) character in it, the syntax highlighting in the web editor gets mixed up and anything after the string is purple (like being part of the string). A workaround is using scriptstr=(... ... ...), but that does not look nice either.

[web2py] upload bug in filename

2010-06-14 Thread Swell
Hi , I tried to send a file with a form containing a upload field( actually it is a SQLFORM). When i try to add a new record with the administrative db interface , it breaks if the filename if very long ( not sure where it comes from ). Any idea? Thx

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Richard
have a look at some of the example apps: http://web2py.com/appliances The main issue with migrating model/controller code into modules is you no longer have access to the global variables like db/session/etc. So you have to pass these variables explicitly to the modules when needed. On Jun 15,

[web2py] Re: Insert current datetime in layout.html

2010-06-14 Thread Richard
If you want this variable globally available for all views then put `giugno = 6' into a model. Or if you only want this variable for a certain view then pass it explicitly in the controller with `return dict(giugno=6, ...)' Then in the view[s] you can use {{= giugno }} On Jun 14, 11:58 pm,

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread Yarko Tymciurak
On Jun 14, 7:19 pm, Richard richar...@gmail.com wrote: have a look at some of the example apps:http://web2py.com/appliances The main issue with migrating model/controller code into modules is you no longer have access to the global variables like db/session/etc. So you have to pass these

[web2py] Re: Documentation on moving common code into modules?

2010-06-14 Thread weheh
+1 regarding Yarko's suggestion. Putting common code into modules is probably the easiest way to have it visible to all controllers. It seems a little kludgy at first, but you get used to it. The one thing to be aware of is that models get executed in alphabetic order. So you may want to stick a

Re: [web2py] upload bug in filename

2010-06-14 Thread Thadeus Burgess
how long is the filename? Isn't there like a 255 char limit to filenames? -- Thadeus On Mon, Jun 14, 2010 at 4:58 PM, Swell swel...@googlemail.com wrote: Hi ,  I tried to send a file with a form containing a upload field( actually it is a SQLFORM). When i try to add a new record with the

Re: [web2py] Re: my app instead of welcome app???

2010-06-14 Thread Thadeus Burgess
Why can't we configure the default name of 'init' ? -- Thadeus On Mon, Jun 14, 2010 at 7:33 AM, mdipierro mdipie...@cs.depaul.edu wrote: or simply call your app init On Jun 14, 7:19 am, Vasile Ermicioi elff...@gmail.com wrote: create routes.py (or rename routes.example.py) from web2py

[web2py] Re: my app instead of welcome app???

2010-06-14 Thread Richard
would that go against the web2py philosophy of having no configuration files? On Jun 15, 1:33 pm, Thadeus Burgess thade...@thadeusb.com wrote: Why can't we configure the default name of 'init' ? -- Thadeus On Mon, Jun 14, 2010 at 7:33 AM, mdipierro mdipie...@cs.depaul.edu wrote: or

[web2py] Re: Internationalization of invalidators' error_message

2010-06-14 Thread dlin
And, if changed to T() form. Will that let the 'doc test' failed in validation functions(such as IS_NO_EMPTY())? On 6月14日, 下午7時57分, mdipierro mdipie...@cs.depaul.edu wrote: Because T is defined in your apps but not in the modules. We could fix this by redefining T using thread local variables.